mattfrear / Swashbuckle.Examples

Adds the [SwaggerRequestExample] and [SwaggerResponseExample] attributes to Swashbuckle
MIT License
121 stars 36 forks source link

SwaggerRequestExample always returns the same example #24

Closed freeranger closed 6 years ago

freeranger commented 6 years ago

Hi,

I have decorated different actions in different controllers with: [SwaggerRequestExample(typeof(JsonPatchDocument), typeof(PatchTypeOneExample))]

and [SwaggerRequestExample(typeof(JsonPatchDocument), typeof(PatchTypeTwoExample))]

ie, the input type is the same - JsonPatchDocument, but the example values are quite different, because they are patching different types of resources.

In my swagger docs though I am seeing the PatchTypeOneExample for both. Is this a bug in the code, or is there some way to override the behaviour?

thanks

freeranger commented 6 years ago

Oops, wrong repo ;)

jerrychoubear commented 5 years ago

@freeranger hi there, so what did you do finally to solve this problem?

mattfrear commented 5 years ago

I don't really support this NuGet package anymore.

The Swashbuckle.AspNetCore.Filters package supports JsonPatch - if you look at my answer on this issue it might work for Swashbuckle.Examples.

https://github.com/mattfrear/Swashbuckle.AspNetCore.Filters/issues/44

jerrychoubear commented 5 years ago

Ok, I'll take a look at it, thanks for the quick reply.