Open CameronGo opened 5 years ago
It's a bug, but may not be the one you're thinking. example
cannot use references, whereas examples
can.
It's a bug, but may not be the one you're thinking.
example
cannot use references, whereasexamples
can.
Interesting, is that an OAS3 constraint or a swagger editor/UI one? If that is indeed the case, the net effect of that is to be unable to use examples in an extensible way. (Since examples support references, but are not supported in schema components, yet example is supported in schema components, but does not support references.)
Also, I'm confused, is it that example should not use references when used in a schema, or it should not use references at all?
After more testing I also see that I'm seeing the same behavior when attempting to nest examples by referencing one example from another. In this case the pictured examples are both under #/components/examples and are referenced in the responseBody, not from the schema. This behavior for certain seems incorrect since AFAIK you are intended to be able to reference one example from another and you should not see the "value" property coming in to the rendering.
@CameronGo it's a bit difficult to follow just with the screenshot? Can you share the full definition please? If you prefer it not to be public, you can email me (email in profile).
I am suffering from the same problem. the editor is not complaining about the schema, but its showing "value", "summary", etc as if it was a part of the schema.
This is incredibly odd, as it pretty much neuters the ability to use examples as components. For any non-trivial response we really have no other choice but to hard code example strings.
Is this on the radar for repairing?
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition:
Screenshots
How can we help?
I'm not certain if this is a bug or working as expected. I'm trying to determine the most efficient way of describing examples for a ContactPoint that could be of type email or telephone. If I reference an example from the components within a schema then the value object from the example is also depicted in the rendered response body. I've tried removing the value object from the example component, but this is interpreted as invalid. If I reference the example from the components within the response body directly, the rendered example correctly depicts the intended structure of the example.