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

Fix DefaultJson documentation #3021

Merged
merged 1 commit into from May 27, 2022
Merged

Conversation

FranAguilarRod
Copy link
Contributor

Subsystem
Client

Motivation
The documentation says that the JSON configuration is "mode is not strict so extra json fields are ignored" but is not what is actually doing.

Solution
Add ignoreUnknownKeys = true to make the JSON configuration work as expected.

@rsinukov
Copy link
Contributor

I'm not sure about this change. It will break the behaviour of existing clients and we better postpone it to majot release. Maybe it's better to fix documentation to reflect an actual behavior?

@FranAguilarRod FranAguilarRod changed the title Fix DefaultJson to ignore unknown keys Fix DefaultJson documentation May 25, 2022
@FranAguilarRod
Copy link
Contributor Author

I agree, I just update the PR to fix the documentation and also add a test to prove the behavior

Copy link
Contributor

@rsinukov rsinukov left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -106,6 +106,17 @@ class JsonSerializationTest : AbstractSerializationTest<Json>() {
)
)
}

@Test(expected = SerializationException::class)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please check native tests here? It fails to compile on CI.
Also, we usually use assertFailesWith<SerializationException> { ... } syntax instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done ;)

Copy link
Contributor

@rsinukov rsinukov left a comment

Choose a reason for hiding this comment

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

LGTM

@rsinukov rsinukov merged commit 9ad97c2 into ktorio:main May 27, 2022
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.

None yet

2 participants