OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

support references for examples

Open fehguy opened this issue 9 years ago • 4 comments

Like other items that support the $ref syntax, would like to have $ref support for example values.

fehguy avatar Apr 06 '16 17:04 fehguy

@fehguy There is a problem with it. example is user supplied data so it can natively have $ref. For example, API that returns JSON Schemas, or any other JSON data since JSON Reference is widely used. And I have a real-life example, Google Discovery is API that returned data format based on top of JSON Schema.

IvanGoncharov avatar Apr 06 '16 17:04 IvanGoncharov

So I guess this can only work easily if we wrap the actual examples in some other format. Is this sensible?

ePaul avatar Apr 07 '16 14:04 ePaul

#636 did some changes related to this, but I'm not sure if this finished this issue.

ePaul avatar Apr 25 '16 16:04 ePaul

@fehguy - see https://github.com/OAI/OpenAPI-Specification/issues/666#issuecomment-213364604.

webron avatar May 19 '16 06:05 webron

PR #636 added Example Objects, and they can be referenced in 3.0. #666 definitively decided that referencing example values (which can look identical to references in some cases) will not be done.

Closing this as resolved with referenceable Example Objects in 3.0.

handrews avatar May 24 '24 16:05 handrews