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

Feat-string-like-field-decoder #1137

Open
wants to merge 1 commit into
base: series/2.x
Choose a base branch
from

Conversation

ThijsBroersen
Copy link
Contributor

@ThijsBroersen ThijsBroersen commented Jun 28, 2024

This PR should provide support for string-like types (T <: String) to be used as keys in json objects.
The implementation reuses any applicable existing JsonDecoder, e.g. a decoder for a string-based const union.

Foo(aOrB: Map["A" | "B", Int]) derives JsonDecoder

value encoded/decoded

Foo(Map("A" -> 1, "B" -> 2))

json

{"aOrB":{"A":1,"B":2}}

@ThijsBroersen ThijsBroersen requested a review from a team as a code owner June 28, 2024 20:04
@ThijsBroersen ThijsBroersen force-pushed the feat-string-like-field-decoder branch from a1102ca to 7cc1d1e Compare June 28, 2024 22:05
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.

1 participant