class Employee(models.Model):
"""
Salaried or contract worker.
"""
...
But after generating the schema.yaml file, we see the Employee scheme as:
Employee:
type: object
description: |-
Extended DRF ModelSerializer class which can avoid naming
collisions and validate immutable fields
Use a "_" suffix on field names to avoid conflicts, which will be
automatically removed in the API field name
Example:
# To use an API field named "type" (which is a reserved Python builtin)
type_ = CharField()
class Meta:
fields = ("type_",)
properties:
id:
type: string
readOnly: true
pattern: ^[-a-zA-Z0-9_]+$
To Reproduce
python manage.py spectacular --file schema.yaml
Expected behavior
Shouldn't the description here be generated from the docstring of the Employee class?
Describe the bug We have a class like:
But after generating the
schema.yaml
file, we see theEmployee
scheme as:To Reproduce
Expected behavior Shouldn't the
description
here be generated from the docstring of theEmployee
class?