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

#2610 signal duplicate properties while parsing #2708

Merged

Conversation

Kasdejong
Copy link
Contributor

Description

JSON deserializer should now correctly identify and report duplicate property keys

Related issues

Resolves issue #2610.

Testing

Unit tests added to assert (fatal) duplicate property keys errors and to assert their differentiation from (recoverable) duplicate array key errors.

@Kasdejong Kasdejong linked an issue Feb 13, 2024 that may be closed by this pull request
Kasdejong and others added 2 commits February 13, 2024 19:20
Co-authored-by: Ewout Kramer <ewout@fire.ly>
Co-authored-by: Ewout Kramer <ewout@fire.ly>
@ewoutkramer
Copy link
Member

We broke it with our last change! It did work before. So maybe the cast can result in null after all?

@ewoutkramer
Copy link
Member

Looks like this should be non-null asserted after all

No, that does not make sense, as the ! is just a compiler hint for static analysis and has no effect on the generated code.

@Kasdejong
Copy link
Contributor Author

Kasdejong commented Feb 15, 2024

With the compiler hint, the code works though... Could it be a runtime type error (nullable/non-nullable)?

EDIT: it was a compiler failure, so this works now :)

@ewoutkramer ewoutkramer merged commit 3501b62 into develop Feb 15, 2024
15 checks passed
@ewoutkramer ewoutkramer deleted the feature/2610-signal-duplicate-properties-while-parsing branch February 15, 2024 12:34
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.

Behaviour of json validation wrt duplicate keys
2 participants