molten icon indicating copy to clipboard operation
molten copied to clipboard

openapi: support required fields read/writeOnly

Open sebdiem opened this issue 6 years ago • 2 comments

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.

sebdiem avatar Feb 04 '19 22:02 sebdiem

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

Bogdanp avatar Feb 11 '19 15:02 Bogdanp

is this actually different than the responseOnly flag?

joranbeasley avatar Feb 25 '19 03:02 joranbeasley