Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

openapi: support required fields read/writeOnly #32

Closed
wants to merge 2 commits into from

Conversation

sebdiem
Copy link

@sebdiem sebdiem commented Feb 4, 2019

The OpenAPI spec 3.0.0 specifies the following for read/writeOnly
schema properties :

readOnly: If the property is marked as readOnly being true and is in
the required list, the required will take effect on the response
only.

This justifies adding a required argument on Field. Indeed this may
be useful to API clients to know that the field will always be present
in the response even if in python its type is Optional due to reuse of
the schema for request and response.

The OpenAPI spec 3.0.0 specifies the following for read/writeOnly
schema properties :

    readOnly: If the property is marked as readOnly being true and is in
    the required list, the required will take effect on the response
    only.

This justifies adding a `required` argument on `Field`. Indeed this may
be useful to API clients to know that the field will always be present
in the response even if in python its type is Optional due to reuse of
the schema for request and response.
@Bogdanp
Copy link
Owner

Bogdanp commented Feb 11, 2019

Thanks! I'll try to take a look at this next week.

@joranbeasley
Copy link
Contributor

is this actually different than the responseOnly flag?

@Bogdanp Bogdanp closed this Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants