-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Labels
P3pull-request-welcomeIf a PR were to be made, we would help get it mergedIf a PR were to be made, we would help get it mergedtype: bug
Description
Q&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Version: 135.0.7049.114
- Method of installation: npm
- Swagger-UI version: 5.20.5
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
Example Swagger/OpenAPI definition:
{
"swagger": "2.0",
"paths": {
"/A": {
"get": {
"responses": {
"200": {
"schema": {
"$ref": "#/definitions/A"
}
}
}
}
}
},
"definitions": {
"A": {
"type": "object",
"properties": {
"nextA": {
"$ref": "#/definitions/A"
}
}
}
}
}Swagger-UI configuration options:
SwaggerUI({
spec: apiSpec,
dom_id: '#api-ui-container',
defaultModelRendering: 'model',
showExtensions: true,
deepLinking: true,
plugins: [DisableTryItOutPlugin],
});Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
Go to Example value of the only endpoint. You will see that it is:
{
"nextA": "string"
}Although the nextA is really an object that follows the same definition, like in
{
"nextA": {
"nextA": {}
}
}Of course in any given value the nextAs must stop at some recursion level, therefore the Swagger UI would have to decide how many levels to include in the example value. But showing a "string" instead is misleading.
Expected behavior
Even an empty object would make more sense. Please display something better than just a string.
Metadata
Metadata
Assignees
Labels
P3pull-request-welcomeIf a PR were to be made, we would help get it mergedIf a PR were to be made, we would help get it mergedtype: bug