-
Notifications
You must be signed in to change notification settings - Fork 80
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
Additional response examples are not honoured #9
Comments
This is a swagger-ui bug: swagger-api/swagger-ui#1213 This was fixed in 3.x ... alas SwashBuckle has not upgraded to 3.x yet, bar one fork on myget by another developer. The temporary workaround for this is to add an example schema on the fly, using an |
Hi Stefan, Yes I noticed the bug you're describing a few months ago, and also found the same related swagger-ui bugs as you have found. However, I didn't find a workaround as you have done - nice work. If you want to submit a PR for your workaround then I will accept it - but for me, personally, it's not a big issue and I'm happy to wait for the swagger-ui fix to be imported into Swashbuckle. |
I'm not sure if I should submit a PR here @mattfrear as it is more of a hack than a fix. What I am doing is the following: 1- I fetch the schema for the type I also added a little hack for Swagger's limitation in rendering arrays, I create an If you want this PR, I'll create it.. it's your call sir. |
Ah ok, thanks - I'll leave it as-is then. Hopefully Swashbuckle will get the swagger-ui fix soon and then it'll all work correctly. |
@Stefan-Z-Camilleri could you post your hack here or a link to a fork so others can benefit from it while we wait for swashbuckle to catch up? Thanks |
I think this is fixed as of Swashbuckle 2.0 which shipped with the new swagger-ui. |
Hi
First of all, thank you for your great library.
In my case, I've been working with this and even modified it a bit. Yet either I am doing something wrong, or I don't know, but examples for additional responses are not being generated for me.
I am using v2.1.1
To the left is the minor modification I made to your library, which simply swaps out the
StatusCode
with a version that has a descriptive version (ex.(200) OK
).As you can see from the screenshot, the examples are being provided using
default
values... yet whilst debugging theIOperationFilter
I can clearly see the example set correctly on theResponse.Examples
object.p.s. this works fine for the request body.
Additional info
The action
One of the examples that is not output
The example is clearly there during debug
What am I missing?
The text was updated successfully, but these errors were encountered: