On Sun, Oct 11, 2020 at 9:52 PM ad...@bit.io <a...@bit.io> wrote:

> Hi All,
>
> I use a number of ModelSerializers and would like my generated OpenAPI
> schema to have a components/schema/<Model> 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
> InlineType17 and so on I'd get 'MyUserModel'.
>
> The feature in OA is: https://swagger.io/docs/specification/components/
>
> I imagine with DRF we'd see each serializer turned into a section in
> components/schemas/<SerializerName>. Does this feature exist?
>

Hey Adam,

That seems to be the default behavior in the current stable version, have
you tried it?
https://www.django-rest-framework.org/api-guide/schemas/#get_components


>
> Thanks!
>
> -Adam
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/27567e07-974a-4ffe-b0e8-d8dc235f3bf5n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-rest-framework/27567e07-974a-4ffe-b0e8-d8dc235f3bf5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CA%2BFDnhKWd00gxq1h8TuFK1AqZNkno9T0M9%3D1c7QUBYPK20yH8Q%40mail.gmail.com.

Reply via email to