Skip to content

Proposal for Required Fields #54

@tfranzel

Description

@tfranzel

spectacular apparently is used by a few people now. i'd like to get some feedback on an idea before doing potentially invasive schema changes.

Theoretically we could make all read-only fields required. Which is imho a better representation of what DRF is actually doing. afaik DRF will always render a field even if it is null. so it is indeed required and not optional. note that this would only apply to responses and not requests.

It is an easy change, but i would like to get feedback beforehand. i don't want to break your schemas/clients. For our purposes it looks very good and the generated clients also honor it well.

i will create a pull request for you to check this out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions