Limit content-types in request body?

2020-10-11 Thread Adam Fletcher
Hi folks, I'd like to limit the request body types I accept to just JSON (this is oddly to work around an `openapi-generator` bug). I see that I can add a `accepted_media_type` to requests - but is there a way to do this for all DRF requests? Thanks! -Adam -- You received this message because

Re: Limit content-types in request body?

2020-10-11 Thread Carl Nobile
You might want to look at the docs for different methods of versioning. The way you do versioning is directly related to how you will use mime types in your code. I personally use the mine type to determine the versions, this allows you to change the version on any endpoint just by changing the ver

ModelSerializers -> OpenAPI components/schemas/ section?

2020-10-11 Thread ad...@bit.io
Hi All, I use a number of ModelSerializers and would like my generated OpenAPI schema to have a components/schema/ section that is referenced by the responseBody section of my methods. Is this possible? This will make my openapi-generater generated code much cleaner - instead of a lot of Inlin

Re: ModelSerializers -> OpenAPI components/schemas/ section?

2020-10-11 Thread Matemática A3K
On Sun, Oct 11, 2020 at 9:52 PM ad...@bit.io wrote: > Hi All, > > I use a number of ModelSerializers and would like my generated OpenAPI > schema to have a components/schema/ section that is referenced by > the responseBody section of my methods. Is this possible? This will make my > openapi-gene

Re: ModelSerializers -> OpenAPI components/schemas/ section?

2020-10-11 Thread Adam Fletcher
Hmm, I’m just using https://www.django-rest-framework.org/api-guide/schemas/#generating-a-dynamic-schema-with-schemaview Should I do more than that? Thanks! On Sun, Oct 11, 2020 at 10:19 PM Matemática A3K wrote: > > > On Sun, Oct 11, 2020 at 9:52 PM ad...@bit.io wrote: > >> Hi All, >> >> I us

Re: ModelSerializers -> OpenAPI components/schemas/ section?

2020-10-11 Thread Matemática A3K
On Mon, Oct 12, 2020 at 12:25 AM Adam Fletcher wrote: > > Hmm, I’m just using > > https://www.django-rest-framework.org/api-guide/schemas/#generating-a-dynamic-schema-with-schemaview > > Should I do more than that? > Should be the same, I'm using djangorestframework-3.12.1 and I see an output as