-
Notifications
You must be signed in to change notification settings - Fork 96
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
Generate valid JSON expected by http://editor.swagger.io #33
Comments
Hey, 1) Swashbuckle.OData supports and displays both WebApi and OData routes that likely have different base paths. Does swagger/swashbuckle support multiple base paths? Thanks! |
I think this enhancement would involve researching and updating this code: why don't the OData media type formatters return true for CanReadType() and CanWriteType()? |
Ran into the Consumes : [] thing today. Can we just hard code "application/json" for now? ;-) I so wish I had the skills to help with PRs & tests etc. Keep up the great work, we understand if you cannot do it all. |
Yeah hard coding would be easiest for now if it's causing issues. |
consumes and produces is now correctly populated in v2.10.1. Please give it a try. Thanks! |
Hi,
I'm not sure if this is really an issue, but an observation that I notice. I'm not sure if this is related to an issue with swashbuckle or is it swashbuckle.OData.
I noticed that when you take the swagger json via "swagger/docs/v1" and copy and paste it on http://editor.swagger.io/#/, there are some potential issues/improvements:
Example: if the URL is "localhost/api/vi/Products GET
Generated json will display: "GET /api/vi/Products" If the baseURL is used, then you can display "GET /Products/" instead.
If these two fields are not filled in, then you will not be able to use the "Try this" for the end point on the swagger UI and an error "Object is missing the required property 'accept'"
It's expecting the "produces": ["application/json"]". If all the endpoints, accept the same it can be marked at the higher level then each endpoint.
However, its interesting the the swagger UI that is generated doesn't have this issue, but the generated .json does. I would expect it to be consistent in terms of the swagger UI and the swagger json that represents the UI to be consistent.
Thanks,
D
The text was updated successfully, but these errors were encountered: