-
Notifications
You must be signed in to change notification settings - Fork 620
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
Support for multiple alternative names during JSON parsing #597
Conversation
runtime/commonMain/src/kotlinx/serialization/json/JsonAlternativeNames.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/JsonAlternativeNames.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/JsonAlternativeNames.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonInput.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/internal/TreeJsonInput.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/internal/TreeJsonInput.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/internal/TreeJsonInput.kt
Outdated
Show resolved
Hide resolved
runtime/commonMain/src/kotlinx/serialization/json/internal/TreeJsonInput.kt
Outdated
Show resolved
Hide resolved
Introduce DescriptorSchemaCache class
Stabilize .toString() for SerialClassDescImpl; because HashMaps on different platforms have different iteration order
Hold cache in Json instance instead of passing it everywhere
Now cache map is not created if main name for property is used
c98be7d
to
ddd6fcb
Compare
Fix documentation and tests
* This cache uses ConcurrentHashMap on JVM and regular maps on other platforms. | ||
* To be able to work with it from multiple threads in Kotlin/Native, use @[ThreadLocal] in appropriate places. | ||
*/ | ||
internal class DescriptorSchemaCache { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type seems like it would be good to be public. It is something that many formats could reuse.
really love to wait for this features merged |
hi, When can this be used? |
Postponed for after-1.0.0 (1.1.0 likely) |
Hey there, |
Hi there 👋 Same here I am really looking forward to this PR to be merged and released 😞 |
I am also looking for this feature. Also it would be nice if aliases could be processed differently. Like I have "durationFrames": 30, "durationMillis": 1000. So json can contain one of the following items. |
Unfortunately 1.1.0 Released without this feature, When It can be used ? |
@mustafaozhan We plan it for the next release |
Superseded by #1375 |
@sandwwraith glad to hear that thanks a lot! |
@JsonAlternativeNames
annotationDescriptorSchemaCache
– class for associating custom format info with descriptors in effective and type-safe wayFixes #203