-
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
Issue with referenced json file example representation on SwaggerUI #4262
Comments
1 ) The "content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Customer"
},
"examples": {
"customer": {
"externalValue": "/assets/examples/models/customers/630432.json"
}
}
} Please note that Swagger UI does not support 2 ) You need to remove The fact that |
Thank you for suggestions. "content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Customer"
}
}
},
"examples": {
"Customer": {
"$ref": "/assets/examples/models/customers/630432.json"
}
} But if you try to show example as array of objects it still works wrong: "content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Customer"
}
}
}
},
"examples": {
"Customers": [{
"$ref": "/assets/examples/models/customers/630432.json"
}]
} |
@AgentSir do you have a full definition you can share? |
The full definition of last code version: |
There is definitely an error popping with that definition: To narrow down the problem can you try an And also try with a ref to a full path like they show on the example |
The API definition is invalid - it's a mix of 2.0 and 3.0, and not really a valid structure of either. |
Closing due to inactivity. This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue. |
We're experiencing the same issue. Any ETA on the fix, or support for |
@erikbozic it would be better to file a new ticket. |
@erikbozic, we fixed an example $$ref issue in Friday's release, can you test with the latest version? |
Yes, it now works with 3.13.0 ! |
Locking due to inactivity. This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report. Thanks! |
Demonstration API definition
Expected Behavior
Swagger UI has to display my example as:
Current Behavior
It renders to UI as following:
Possible Solution
The issue has been already discussed there: #3638
The text was updated successfully, but these errors were encountered: