Skip to content

Support one of these parameters as required? #207

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

Closed
xytian315 opened this issue Nov 17, 2014 · 4 comments
Closed

Support one of these parameters as required? #207

xytian315 opened this issue Nov 17, 2014 · 4 comments

Comments

@xytian315
Copy link

I have an app which uses three parameters for a request, the paramType is 'form'. I want it to be at least one of these 3 parameters as required. Does swagger support that?

@fehguy
Copy link
Contributor

fehguy commented Nov 18, 2014

no, you cannot have conditional required state on the parameters. You could certainly enforce this in your UI.

@xytian315
Copy link
Author

Thank you very much for your quick response! Yeah, I want it to be conditional required in my Swagger UI. Can I do that? Do you suggest me to set "required" to "true" to all three parameters?

@fehguy
Copy link
Contributor

fehguy commented Nov 18, 2014

Yes, I suggest you add some logic inside a fork of swagger-ui, it should be pretty easy to do so.

On Nov 17, 2014, at 5:32 PM, Xiaoyi Tian notifications@github.com wrote:

Thank you very much for your quick response! Yeah, I want it to be conditional required in my Swagger UI. Can I do that? Do you suggest me to set "required" to "true" to all three parameters?


Reply to this email directly or view it on GitHub #207 (comment).

@webron
Copy link
Member

webron commented Mar 6, 2015

Closing this for now. Please reopen if still an issue.

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

No branches or pull requests

3 participants