Replies: 1 comment 2 replies
-
@handrews brought up some concerns in the thread.
I have zero experience developing specs and only an novice level understanding of working with the complexities of OpenAPI. I guess to me the simplest thing to do, would be potentially a backwards compatible change, where you make a new field (that is always) a string value, and you always interpret it as its content type. This would provide a clean separation between the specification document, and the example document. It would be easier for processing and tools to manipulate clearly (if for example you are styling or bundling documents with redocly, or resolving yaml anchors, the examples would not be touched), today if you have a comment in the Yaml example it's likely interpreted as a comment of the spec by most tools, and tools can't really know whether a comment in the example is part of the example or part of the openapi spec. I think just forcing everything to be a string would be cleaner. Providing a new key would likely provide an easy migration path since. Anyway just some thoughts. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
FYI there was a slack thread where this was mentioned and I'm just bringing it here, several months late.
In the spec today it mentions that:
To me that sort of implies that JSON and YAML cannot be encoded as a string., I found this thread: OAI/OpenAPI-Specification#3289 that kind of confirms it, thought it links to another issue, that links to a thread that doesn't seem to be a thread.
I was curious about proposing that it be allowed to be string encoded. I guess the main reasons would be:
</handwaving>
. For example I might want to format and style an example differently than the spec. Some other tools for instance likeyq
which we use to post process them, just completely obliterate the examples, but I assume it will not care that I used JSON syntax and convert it to YAML.Beta Was this translation helpful? Give feedback.
All reactions