drf-yasg icon indicating copy to clipboard operation
drf-yasg copied to clipboard

Subclass SchemaGenerator instead of defining a new one

Open kevin-brown opened this issue 4 years ago • 0 comments

While the SchemaGenerator provided by DRF-YASG is not API-compatible with the one used by DRF, it does use a lot of the methods and even generates a DRF one internally. Given that this required quite a bit of extra code to be written to do the wrapping, it makes sense to instead just subclass it and get those additional benefits.

This should make it easier to migrate from the CoreAPISchemaGenerator, which is what is currently being used, to the DRF-provided OpenAPISchemaGenerator for the internal serialization. That was not done here because there is still a lot of work that needs to be done in order to enable that.

kevin-brown avatar Oct 04 '19 12:10 kevin-brown