-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
A new parameter 'body' gets added for hash type params #67
Comments
This is an artifact of the way the I'll add an option to omit the enclosing (fake) |
Is there any way that I could prevent the enclosing from my side? |
You can patch bodyParams.push(param); It should be line 275. |
That's because it's showing a nested properties under the object that we've just hidden. If you change the offset 0 to -1 on the following line, they should go away: let props = common.schemaToArray(data.bodyParameter.schema,0,{trim:true},data); Line 278. Thanks for testing my changes I haven't even written yet! |
Awesome! Thanks for that :) Mike, am also facing an issue with the required field as said above. If you take a look at the first screen shot, the parameter password is mentioned as required in the Swagger JSON but in the markdown, the field is set to false. And in the screenshot that I have added in the subsequent comment, every field is a required one. But only the email field is set as required. Is this an issue or am I doing anything wrong? |
This was a bug in the OpenAPI 2.0 to 3.0 converter. When the next beta of widdershins is released (hopefully later today) it will have the updated converter dependency. Thanks again for the testing and the bug reports! |
Apologies for the delay, widdershins@3.0.0-beta0.1 has just been released. |
Widdershins v3.0.0 has just been released. |
Thanks a lot for the update Mike! |
Specs
I am using parameters of type hash for our APIs. Swagger generates the JSON as given below
"paths":{"/betaweb/users/sign_in":{"post":{"description":"User Authentication API","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"formData","name":"user[email]","description":"User email","type":"string","required":false},{"in":"formData","name":"user[username]","type":"string","required":false},{"in":"formData","name":"user[password]","description":"User Password","type":"string","required":true}],"responses":{"201":{"description":"Created"},"422":{"description":"Invalid Login Credentials"}},"tags":["users"],"operationId":"User Authentication API"}},
But my Slate Markdown adds a parameter body to my request as below.
I couldn't figure out to remove the body parameter.
And also, the password parameter required is set to true in the Swagger JSON. But the in the documentation, required field for password is set to false
The text was updated successfully, but these errors were encountered: