Skip to content

Made fields case insensitive.#91

Open
Spelt wants to merge 1 commit into
ahausladen:masterfrom
Spelt:master
Open

Made fields case insensitive.#91
Spelt wants to merge 1 commit into
ahausladen:masterfrom
Spelt:master

Conversation

@Spelt
Copy link
Copy Markdown

@Spelt Spelt commented Jun 3, 2026

Hi

This pull request is making the json fields case insenstive. This is not according to the json standard so I do understand a rejection.

The problem which is being solved is that sometimes OpenApi definition files are defining the fields correctly like: { "Key": "Value" } but the json response can be{ "key": "Value" }. This depends on which server software is used (in this case .net 6 json serializers). Everything then breaks because sometimes we are not able to change the response.

Maybe another way to this is better.

One more thing: some of the current tests will fail but thats because of specific case sensitive test cases.

Hope it helps!

Sincerly Edward

@ahausladen
Copy link
Copy Markdown
Owner

ahausladen commented Jun 3, 2026

Changing all property names to be case-insensitive leads the bugs, if the JSON actually contains two properties with the same name but different casing in the same object. With your Pull Request the behavior changes for all objects without a way back. And the default should be "case-sensitive".

I thought about a config object that you can set on the root object, that is inherited by every child object/array. But unfortunately the JsonDataObject architecture with its helper and value records doesn't allow that. There is no way to get the root or parent from a value record without increasing the memory a lot by adding a back reference to the parent into those records. The architecture would have to change what would make keeping API backward compatibility hard. And with my time constraints I doubt that that will happen (but never say never).

A bad solution is to make the case-in/sensitive configuration a threadvar or a global variable.

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

Successfully merging this pull request may close these issues.

2 participants