-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
MVCSwagParam ptArray Bug #377
Comments
I will check this behavior |
Also I have problem with [MVCSwagResponses(200, 'ok', INDEX_JSON_SCHEMA)] where maybe these errors are related |
Using the last commit from dmvc I did these tests and when I define the parameter type as an array, the generated JsonSchema shows it as an array. However when you use enumerators the value of an enumerator cannot be an array. See https://swagger.io/docs/specification/2-0/enums/ |
yes, if this object then working, but me need array objects |
I tested this in editor.swagger.io array may contain enum |
This object represented as an array should look like this: {
"type": "array",
"items": {
"type": "object",
"properties": {
"application": {
"type": "string",
"description": "Application Name"
},
"online": {
"type": "boolean",
"description": "Defines if the server is online"
},
"serverdatetime": {
"type": "string",
"description": "Current server time"
}
}
}
} |
I agree see my post #377 (comment) but this not worked |
I think you're missing something. In my tests it is working correctly; See this attached sample. Enumerators and array of objects work correctly: |
Ok, I test tomorrow and answer |
Yes, array of objects work correctly, I have extra comma in my example.
|
Indeed, swagger middleware does not support enumerators as an array. We will implement this functionality soon. |
Is it possible for now to implement this parameter through AJsonSchema? |
I believe it is possible. However it is necessary to test to be sure of this. |
I couldn’t do it ( |
What is the status of this problem ? We are facing similair problem now. |
When we add support for OpenAPI 3.0 we intend to correct this problem. |
Hi!
I use RC6 and applied changes from fix #376
When you use
MVCSwagParam(plQuery, 'types', 'types', ptArray, false,'','money,loading,unloading')
result in json:
{
"in": "query",
"name": "types",
"description": "types",
"type": "array",
"enum": [
"money",
"loading",
"unloading"
]
}
but it should be:
{
"name": "types",
"in": "query",
"description": "types",
"type": "array",
"items": {
"type": "string",
"enum": [
"money",
"loading",
"unloading"
]
}
}
The text was updated successfully, but these errors were encountered: