Support the "readOnly" and "writeOnly" attribute #49
Labels
enhancement
New feature or request
smartbear-supported
Issues with this label have been added to the Pactflow team's Jira backlog
From https://swagger.io/specification/v3/?sbsearch=readOnly
That is, attributes marked as "readOnly" in a shared model between request and response bodies should only be part of the response,
writeOnly
attributes should only be part of the request body.The validator currently does not consider these attributes, which makes it hard to re-use models on the request and response.
Given this model:
An error will show if the
created_at
property is not in the request, despite it being aread-only
property:Workaround
The workaround is to separate request and response schemas, perhaps using other composition capabilities of JSON schema.
The text was updated successfully, but these errors were encountered: