-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference definition itself is rendered to example content #4021
Comments
Also the "value" Property is wrong "value" is part of the Definition, not part of the example content: |
The spec does not support references for As for your second comment, I didn't get what you meant. |
With the second comment, I meant it should only be rendered {
"message": "Hello, World!"
} and not: {
"value": {
"message": "Hello, World!"
}
} as is thought "value" is the property name within the Example Object definition and not part of the example data. But with your answer, that everything is rendered as-is, this makes sense. But for the first question I still think this is a rendering issue. When the reference is not interpreted than I would expect this content:
When the reference is interpreted and "executed" I would expect this:
But actually rendered is this, so the reference is "executed" but also the reference definition is shown.
|
Heh, yeah, I blame @shockey for that. |
Hmm, yeah - this is probably something that moved around with the Swagger-Client resolver. Should be a simple fix 😄 |
Fixed! |
This is only fixed is the $$ref key is in the first level. This example shows the ref key. openapi: '3.0.0'
info:
title: 'test'
version: '1.0.0'
paths:
/hello:
get:
description: 'Get welcome message.'
responses:
'200':
description: 'welcome message'
content:
application/json:
schema:
$ref: '#/components/schemas/Welcome'
components:
schemas:
Welcome:
type: object
properties:
message:
type: string
example:
a:
$ref: '#/components/examples/WelcomeExample'
examples:
WelcomeExample:
value: {
"message": "Hello, World!"
} |
@alexgmin thanks for the heads up on that! I just merged a fix for that as well. |
I'm having this issue with an array of |
Demonstration API definition
Configuration (browser query string, constructor, config.yaml)
none using just http://editor.swagger.io
Expected Behavior
Not show the line marked in the following image.
Current Behavior
See red marker in this image:
Possible Solution
none
Context
none
The text was updated successfully, but these errors were encountered: