Swashbuckle.webapi: [Question] Use custom serializer to serialize objects?

Created on 27 Jan 2015  路  4Comments  路  Source: domaindrivendev/Swashbuckle.WebApi

Swashbuckle seems to serialize objects to camel case, I use NewtonSoft lib to serialize objects in the app which has an attribute [JsonProperty(name="")] and these are used in serialization. Is there a way I can customize Swashbuckle to use the same api used in the application?

Most helpful comment

An answer to this question "But is there way we can plug in a different serializer? Thanks again." would be great

All 4 comments

Hey there

Swashbuckle 5.0 honors Json attributes out-of-the-box. It's currently in alpha and is available as a Nuget pre-release:

Upgrade-Package Swashbuckle -Pre

It does introduce some significant changes including a move to Swagger 2.0 and subsequent changes to the config API. If you're only using the UI, it should remain relatively unchanged, If you have other consumers of the raw Swagger document, you'll need to ensure they can accept Swagger 2.0.

Finally, if you're using the Swashbuckle config API extensively, you should take a look at the transition guide here - https://github.com/domaindrivendev/Swashbuckle/tree/swagger_2.0#transitioning-to-swashbuckle-50

Other than that, the upgrade should be relatively seamless. Complete docs for the alpha version are available here - https://github.com/domaindrivendev/Swashbuckle/tree/swagger_2.0

Let me know how it goes ...

Great, thanks for the swift response. It definitely resolves my issue.
But is there way we can plug in a different serializer? Thanks again.

This is fixed!

An answer to this question "But is there way we can plug in a different serializer? Thanks again." would be great

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joseph-ortiz picture joseph-ortiz  路  4Comments

josephearl picture josephearl  路  4Comments

rautsik picture rautsik  路  4Comments

maheshmohandas picture maheshmohandas  路  4Comments

DotNetRockStar picture DotNetRockStar  路  3Comments