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 JSON encoding if specified #1477

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

brharrington
Copy link
Contributor

If a class extended JsonSupport and provided a custom encoding it would get used by the interited methods, but would get ignored when using Json.encode. This could create problems when an object is nested because the custom encode would not get used. The Json.encode could not directly call encode, because it would create a loop with the default implementation.

This change adds a method that can indicate if it is desirable for Json.ecnode to use the custom encoding.

If a class extended JsonSupport and provided a custom
encoding it would get used by the interited methods, but
would get ignored when using `Json.encode`. This could
create problems when an object is nested because the
custom encode would not get used. The `Json.encode`
could not directly call encode, because it would create
a loop with the default implementation.

This change adds a method that can indicate if it is
desirable for `Json.ecnode` to use the custom encoding.
@brharrington brharrington added this to the 1.7.0 milestone Oct 28, 2022
@brharrington brharrington requested a review from manolama October 28, 2022 19:56
@brharrington brharrington merged commit 3143e37 into Netflix:main Oct 28, 2022
@brharrington brharrington deleted the jsonsupport branch October 28, 2022 22:44
manolama pushed a commit to manolama/atlas that referenced this pull request May 22, 2024
If a class extended JsonSupport and provided a custom
encoding it would get used by the interited methods, but
would get ignored when using `Json.encode`. This could
create problems when an object is nested because the
custom encode would not get used. The `Json.encode`
could not directly call encode, because it would create
a loop with the default implementation.

This change adds a method that can indicate if it is
desirable for `Json.ecnode` to use the custom encoding.
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