You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenAPI has a fundamental limitation with examples and $refs. You can put examples in referenced types, but if that type is something really generic like a JSON API link or our stripped-down relationship type, the example isn't going to be very relevant to the resource that you're reading about.
OpenAPI 3.1.0 took a step in the right direction, allowing summary: and description: to be used with $ref:.
Proposal: x-snyk-ref-example
Until OpenAPI catches up, proposing an extension x-snyk-ref-example that provides this capability. An extension is used so that it is clear and explicit that this is not yet standard OpenAPI behavior. It also gives us a clear way to ignore or adapt OpenAPI lint rules that might otherwise fail on it.
A better alternative to consider is requiring sub-typed links to be used in resources, which would then have actually-relevant examples. Then we don't need a custom extension.
OpenAPI has a fundamental limitation with examples and $refs. You can put examples in referenced types, but if that type is something really generic like a JSON API link or our stripped-down relationship type, the example isn't going to be very relevant to the resource that you're reading about.
OpenAPI 3.1.0 took a step in the right direction, allowing
summary:
anddescription:
to be used with$ref:
.Proposal:
x-snyk-ref-example
Until OpenAPI catches up, proposing an extension
x-snyk-ref-example
that provides this capability. An extension is used so that it is clear and explicit that this is not yet standard OpenAPI behavior. It also gives us a clear way to ignore or adapt OpenAPI lint rules that might otherwise fail on it.Example:
The text was updated successfully, but these errors were encountered: