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
Media Type appearing in the UI for examples #12
Comments
Oh wow I never noticed that before - I'm not sure if there's a way to get
rid of it. I'll have a look when I get a chance.
…--
*Matt Frear*
matt.frear@gmail.com
On 30 August 2017 at 18:13, freeranger ***@***.***> wrote:
Hi,
I'm using Swashbuckle.AstNetCore 1.0.0 with Swashbuckle.AspNetCore.Examples
with version 2.1.1 of your package.
In the swagger UI I am seeing the media type as part of the model:
[image: image]
<https://user-images.githubusercontent.com/1401069/29885437-c4779f18-8dae-11e7-84fc-8f2263d82905.png>
Which I wasn't expecting - is there a way to stop this happening
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKU292GMLzeogpZTbKvMAXLdpPCUBYMks5sdZgkgaJpZM4PHtFq>
.
|
OK I've figure out why it's doing that, but I have to find time to write a fix and publish the NuGet package. Offending line of code is in ExampleOperationFilter.cs:
I can't even remember why I create a Dictionary, it might have been to get the Request examples working cos it seems it's not needed for the Response examples... |
Thanks for the quick response - I'll take a look |
Hi - I took it out completely, so not used for request or response and it works fine in both cases. |
Hmm when I took it out I wasn't seeing the Request examples being set correctly |
Can you post the code you've changed? |
Here is my code with the change: freeranger@ee9469d |
Thanks @freeranger, works great, so I was able to tidy up the code more. ac0090b |
I have reverted this change in 2.2.2, because the previous response example with the application/json was correct as per the Swagger 2.0 spec. So maybe it's a bug with either Swashbuckle or Swagger-ui as to why application/json is appearing in the UI. |
Hi,
I'm using Swashbuckle.AstNetCore 1.0.0 with Swashbuckle.AspNetCore.Examples with version 2.1.1 of your package.
In the swagger UI I am seeing the media type as part of the model:
Which I wasn't expecting - is there a way to stop this happening
The text was updated successfully, but these errors were encountered: