Skip to content
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

[Question] Use custom serializer to serialize objects? #170

Closed
nf17 opened this issue Jan 27, 2015 · 4 comments
Closed

[Question] Use custom serializer to serialize objects? #170

nf17 opened this issue Jan 27, 2015 · 4 comments

Comments

@nf17
Copy link

nf17 commented Jan 27, 2015

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?

@nf17 nf17 changed the title Use custom serializer to serialize objects? [Question] Use custom serializer to serialize objects? Jan 27, 2015
@domaindrivendev
Copy link
Owner

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 ...

@nf17
Copy link
Author

nf17 commented Jan 27, 2015

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

@nf17
Copy link
Author

nf17 commented Feb 4, 2015

This is fixed!

@nf17 nf17 closed this as completed Feb 4, 2015
@muehan
Copy link

muehan commented Nov 7, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants