extend_schema
with OpenApiResponse
results in description: null
in generated schema
#591
Labels
bug
Something isn't working
fix confirmation pending
issue has been fixed and confirmation from issue reporter is pending
Describe the bug
When using
extend_schema
to add examples to an endpoint, if you do not give a value for theOpenApiResponse
'sdescription
parameter then it will produce a schema withdescription: null
rather thandescription: ''
. This is invalid according to the specification.This prevents the schema from being used by
openapi-python-client
to generate client libraries.I think this is because the default value in
OpenApiResponse.__init__
isNone
when it should be''
.Obviously, there is a workaround of simply providing
description=''
toOpenApiResponse
(or, you know, an actual description).To Reproduce
Expected behavior
The schema should contain
description: ''
when no description parameter is passed toOpenApiResponse
, just like it does by default when not usingextend_schema
.The text was updated successfully, but these errors were encountered: