-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How to send the Default value through body in Swagger 2.0 #1844
Comments
How is this issue related to swagger-core? Also, I think you're missing the point of the default value. The default value is one that's assumed by the receiving end (either the server or the client) if the sender does not provide a value for it - it's not what automatically should be filled. |
Is this related to springfox/springfox#1345 (comment)? The authors of SpringFox claim that the reason why their Swagger UI integration does not take default body is that your API is not taking the default body. @jeevanhr7 Is this related to your issue? @webron Can you please confirm that? For the case of Swagger UI, wouldn't we need to have the support for default values? |
There's nothing in this ticket to even suggest it's related to java, let alone swagger-core specifically. Regarding the general question - body parameters can have default values. The Schema Object has a |
@webron I think the problem is that |
@dilipkrish the |
@webron thanks for checking this... @dilipkrish Could you verify what @webron was referring to about the Model? The body to our API is a complex type that it is very hard to produce... That's why I need to get an instance of the payload built and injected through SpringFox... Thank you guys! |
I'm also having somewhat of an issue using the "default" value for a Body Parameter. I have editor.swagger.io confirming that the setup is valid, and I included the "default" value under "schema" like @webron recommended. However, the "default" field does not seem to be populated in the text field in the web view of the API. Every other "default" value properly populates for non-body parameters. @webron is this issue what you were referring to when you mentioned "potentially accessors are missing from Model."? |
@Alin-Barsan I'm not really sure what you mean by 'web view' - don't know which project you're referring to. However, by the sound of what you're describing, again, this is not related to swagger-core. Please open a ticket on whichever project you experience the issue with. |
@webron Hi Ron, thanks for the response! By 'web view' I meant the Swagger UI, I'll go ahead and search for a relevant ticket (or open a new one if none exists) on that project. |
@Alin-Barsan - thanks. @marcellodesales - I'm afraid I don't see the source of confusion. |
@jeevanhr7 In swagger 2.0 for body parameters default value is set by "example" keyword |
Hi i am trying to send the Default values through body parameters but its Not taking while Submitting. can anybody please help me on this issue. Here is my code and i am trying to send the default name parameter through body
The text was updated successfully, but these errors were encountered: