-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Response with array different then 200 doesn't show. #1055
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
Comments
You mean it doesn't display it for default and 422? |
The model schemes for 200 and default are fine, but the 422 is an array of ValidationError and the "Model" and the "Model Scheme" tabs in UI are empty. |
Is there actually a ValidationError model in the definition? It would help if you shared your whole Swagger definition for testing. |
|
Which library produced that spec? |
zircote/swagger-php v2.x |
I believe this is related to swagger-api/swagger-js#270. |
@marcinskubala - do you mind if I use the Swagger definition you shared here to open an issue on swagger-php? There are three problems with it they should solve. |
@webron - fill free to share this code, thanks |
@marcinskubala - thanks. @mohsen1 - can you please confirm this is the same issue? |
Have the same issue, with this schema where the response model is missing for everything but 200: {
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Test sample showing swagger error",
"description": "Show that response headers are not rendered",
"contact": {
"name": "Troels Liebe Bentsen",
"email": "[email protected]"
}
},
"host": "localhost",
"basePath": "/",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/test": {
"post": {
"summary": "Test",
"description": "Test stuff",
"operationId": "doTest",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/test"
}
}
},
{
"in": "header",
"name": "ETag",
"description": "Used as caching key for future requests",
"type": "string"
}
],
"responses": {
"200": {
"description": "Test stuff response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/test"
}
},
"headers": {
"ETag": {
"description": "Used as caching key for future requests",
"type": "string"
}
}
},
"405": {
"description": "Invalid input",
"headers": {
"ETag": {
"description": "Used as caching key for future requests",
"type": "string"
}
},
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/test"
}
}
}
},
"tags": ["test"]
}
}
},
"definitions": {
"test": {
"required": [
"test1",
"test2"
],
"properties": {
"test1": {
"type": "string"
},
"test": {
"description": "Amount to be payment",
"type": "number",
"format": "double",
"default": 0
}
}
}
}
} |
@mohsen1 can you please look at this? |
Updated to latest version from master and I still see the issue |
I've spent some time looking into this issue. I don't know exactly what we should do here because the way we're passing We're resolving I think |
I agree, a little refactoring would be great. I kinda went looking at the same problem... |
please follow parent issue #1248 |
Hi, ui doesn't show the model shema.
The text was updated successfully, but these errors were encountered: