Skip to content

Conversation

@valdemon
Copy link
Contributor

@valdemon valdemon commented Apr 6, 2015

Hi,

This addresses eg. the #982 and #987 and likely some others around the subject.
Except of the multi-line text area for the array type params, I've also got a rid of the 'required' and 'default' attributes of the array type parameters.

Please check the use cases here: https://swagger-test-valdemon.c9.io
The above sample UC additionally cover aspects of required parameters and/or default values in a context of the array type.

The validation error (shown in Swagger UI bottom right) is related to declaring the default value as array for the array type parameter, which doesn't sound like wrong I'd say, according to: http://json-schema.org/latest/json-schema-validation.html#anchor101.
Checking the sample 'swagger.json' against any JSON schema validator succeeds btw.

@webron: this is the #1121 duplicate, now created against the develop_2.0 branch.
The #1121 branch was created from develop_2.0 branch, I've only missed, that the master branch is proposed as default when creating any PR. Sorry for the inconvenience.

Best,
Waldek

valdemon added 2 commits April 3, 2015 14:31
…extarea.

Improved required parameter handling for the array type.
Improved default value handling for the array type.
@exoszajzbuk
Copy link

@valdemon If I understand right, this PR deals with the textarea thing from the UI side, the actual collectionFormat options - like brackets mentioned in #987 - will be handled by swagger-js?

@valdemon
Copy link
Contributor Author

valdemon commented Apr 7, 2015

@exoszajzbuk yes, exactly. And the swagger-js does that well in current develop_2.0 branch.

@fehguy fehguy merged commit ad56131 into swagger-api:develop_2.0 May 8, 2015
@fehguy
Copy link
Contributor

fehguy commented May 8, 2015

thanks! Looks great.

@aosavitski
Copy link

Such an old issue, but still leads to "The validation error (shown in Swagger UI bottom right)" :(

@fehguy
Copy link
Contributor

fehguy commented Feb 16, 2017

@life4beer that's a completely different issue

@aosavitski
Copy link

@fehguy , could you please give me a number of the validation error issue, so that I could monitor the progress?

@malkochoglu
Copy link

Hi,
I am trying this with annotations on my API class. By:
@ApiParam(name="paramX", required=true, allowMultiple=false, allowableValues="X1, X2, X3, X4",defaultValue= "X2")

But I only see a text box instead of list box. I had done this with json file before. I am trying to get the same with annotations. Isn't it supported if I use annotations? If it is supported which version do I need or
Thanks

@webron
Copy link
Contributor

webron commented Jul 20, 2017

@malkochoglu this is not a question for swagger-ui, but for whichever project you use to generate the API definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants