api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

Capture rules relative to required fields and how they should be modeled in OpenAPI

Open markweitzel opened this issue 4 years ago • 0 comments

The following rules need to be captured, either in a section on JSON models OR in a complementary document on OpenAPI.

If you also support PUT then, then model depends on whether you have a required fields or not. If you have no required fields, then again, you can use 1 model for everything. If you have some required fields, then create a model with the required fields for PUT request/response, GET response, and PATCH response. Use a separate model where NO fields are required for PATCH request.

Also, note that you can never add new required fields to a model as this is a breaking change.

markweitzel avatar Jun 02 '21 14:06 markweitzel