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

Merged

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
@987Nabil
Copy link
Contributor

@plokhotnyuk can we merge this?

@ThijsBroersen ThijsBroersen force-pushed the feat-string-like-field-decoder branch from 7cc1d1e to 9446afa Compare January 26, 2025 11:46
@ThijsBroersen
Copy link
Contributor Author

rebased and tested it again. All seems OK, mima passes

@plokhotnyuk plokhotnyuk merged commit 96119fe into zio:series/2.x Jan 26, 2025
31 checks passed
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.

3 participants