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

Use custom serializer for snake case #21

Merged
merged 7 commits into from
Apr 28, 2021

Conversation

tl-antonio-valentini
Copy link
Contributor

@tl-antonio-valentini tl-antonio-valentini commented Apr 27, 2021

This PR adds snake_case support when serializing/deserializing request adn responses.

Here is the main issue tracked on the dotnet repo, to add snake_case support directly onto System.Text.Json.
And this is a proposed implementation, which could be approved for .NET 6. It is very similar to the Newtonsoft one.

This way we avoid having lots of [JsonPropertyName] around the codebase, and when .NET 6 is out, it will almost be a single line change on our side.

Close #4

NewWord
}

public static string ToSnakeCase(this string s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks prime for Benchmark .NET 😄

@tl-antonio-valentini tl-antonio-valentini merged commit d5fe476 into main Apr 28, 2021
@tl-antonio-valentini tl-antonio-valentini deleted the use-pascal-case-for-req-res-props branch April 28, 2021 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Use Pascal Case for all Request/Response Properties
2 participants