stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.43k stars 235 forks source link

oas3-valid-media-example reports on missing examples where response body uses a required but read only property #2490

Closed savage-alex closed 1 year ago

savage-alex commented 1 year ago

Given a schema that contains a readonly and required property such as fooId When this schema is used in a response body and a schema level example is provided without fooId (its read only) The OAS3 valid media example error is thrown even though the schema is valid vs openAPI3 rules on read only required properties in requestBodies.

Thanks

LasneF commented 1 year ago

isnt it a duplicate of #1274

mnaumanali94 commented 1 year ago

Duplicate of #1274