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

JSON casing breaking change 4.0 #217

Open
DanFTRX opened this issue Jan 20, 2023 · 3 comments
Open

JSON casing breaking change 4.0 #217

DanFTRX opened this issue Jan 20, 2023 · 3 comments
Labels

Comments

@DanFTRX
Copy link

DanFTRX commented Jan 20, 2023

13f25f9 added camel case overrides on all json serialization in the library. This is a change from before when it would preserve the casing provided. It's also not easily worked around as the JsonSerializerOptions are private in the JsonMapper class.

@DanFTRX DanFTRX changed the title JSON casing breaking change 4.1 JSON casing breaking change 4.0 Jan 20, 2023
@dvsekhvalnov
Copy link
Owner

Hey @DanFTRX ,

i guess it was intentional, can't recall why exactly today, but probably there were a reasons.

I'm curious to see unit tests that were working on v4.0 but broken now on 4.1?

@DanFTRX
Copy link
Author

DanFTRX commented Jan 23, 2023

My problem is that I have a different language client with a case sensitive JSON parser (I could write you a unit test showing you that a case sensitive parser won't work with the new casing, but I'm not sure that will be useful). One could argue that case sensitivity on the client was a mistake, but I can't change the past and in the end a change to the library has broken my workflow.

I understand the new default may be intentional, but can you provide the ability to modify the settings on the JsonMapper class (or a constructor that takes in a SerializationSettings and DeserializationSettings rather than the defaults) to allow easy modification of this new behavior without having to recreate the entire class?

Also this change in behavior should be documented in the release notes for the release it occurred in. (I think it was the 4.0 release?)

@dvsekhvalnov
Copy link
Owner

Yeah, can do it, seems to be same request as #214

One thing is, i'm not sure what will break if you change default casing. May be more viable option for you will be to use methods that returning bare string and handle json serialization yourself behind library?

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

No branches or pull requests

2 participants