From drf-yasg to OpenAPI 3ΒΆ
drf-yasg is an excellent library and the most popular choice for generating OpenAPI 2.0 / Swagger schemas with DRF. Unfortunately, it currently does not provide OpenAPI 3 support. Migration from drf-yasg to drf-spectacular requires only minor modifications.
@swagger_auto_schema
is largely equivalent to@extend_schema
.manual_parameters
is calledparameters
openapi.Parameter
is roughly equivalent toOpenApiParameter
.@swagger_serializer_method
is equivalent to@extend_schema_field
.ref_name
on SerializerMeta
classes is supported (excluding inlining withref_name=None
)