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

Default typeHint field value #522

Closed
wants to merge 1 commit into from
Closed

Default typeHint field value #522

wants to merge 1 commit into from

Conversation

mladens
Copy link
Contributor

@mladens mladens commented Jul 31, 2023

In order to add alternatives to existing types with an ADT in a backwards compatible way we declare the current type to be one of the implementations of new hierarchy. New clients will always be sending type hints whereas old will not.

This PR expands JSONTypeHintField with additional parameter, designating which impl to fallback to if hint is not provided at all.

@mladens mladens requested a review from yanns as a code owner July 31, 2023 08:12
String defaultType() default "";
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you though about using null vs "". What arguments put in the balance of using ""?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, i just saw it was default for JSONTypeHint.value and followed that

@mladens mladens closed this Sep 6, 2024
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