-
Notifications
You must be signed in to change notification settings - Fork 601
Add hide_parameters in yaml config #279
Comments
create a second serializer instead. On Sun, May 17, 2015, 01:47 shuo [email protected] wrote:
|
I guess we can also create multiple views to replace viewset? |
Not sure what you mean. Just inject the car in serializer save. On Sun, May 17, 2015, 03:19 shuo [email protected] wrote:
|
I use one serialiser class for both endpoints, for endpoint, /api/cars/{carId}/wheels/ POST, generated swagger doc has two params: carId in url and car defined in serialiser. I need to hide the one from serialiser class. |
You are doing it wrong. On Sun, May 17, 2015, 03:26 shuo [email protected] wrote:
|
What is wrong? |
Why are you trying to hide a parameter that the serializer handles?seems On Sun, May 17, 2015, 03:33 shuo [email protected] wrote:
|
I am setting the serialiser's param in view's function, it is not hidden, just set in a different way. I don't think it is a good idea to create a new Serialiser class for such simple things. |
I agree that security is not the responsibility of the doc generating On Sun, May 17, 2015, 03:50 shuo [email protected] wrote:
|
I need to hide some parameter if following cases:
There are 2 models, car and wheel. And two endpoints to create wheel:
/api/cars/{carId}/wheels/ POST
/api/wheels/ POST
My wheel serialiser has field car, which is perfectly good in 2nd endpoints, but annoying in the first one. Because I already has carId there. I think a proper way to do this is add one hide_parameters list which quite like omit_paramters. But this one hide paramters by their name instead of type. Any idea?
The text was updated successfully, but these errors were encountered: