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

Add object-based serialization and deserialization of polimorphic types in JSON on JS platform #1122

Merged
merged 1 commit into from Oct 22, 2020

Conversation

shanshin
Copy link
Contributor

@shanshin shanshin commented Oct 8, 2020

  • implement JSON serialization (deserialization) of polymorphic type from (to) dynamic with discriminator
  • add tests on object-based and array-based polimorphism encoding and decoding on JS
  • fix array-based encodind polymorphism to dynamic type on JS

…es in JSON on JS platform (#835)

 * implement JSON serialization (deserialization) of polymorphic type from (to) dynamic with discriminator
 * add tests on object-based and array-based polimorphism encoding and decoding on JS
 * fix array-based encodind polymorphism to dynamic type on JS
@sandwwraith sandwwraith merged commit 5a8f09f into dev Oct 22, 2020
@sandwwraith sandwwraith deleted the json-js-object-poly-835 branch October 22, 2020 12:23
@ankushg
Copy link
Contributor

ankushg commented Oct 28, 2020

I know this has already been merged, but does serializing to/from dynamic actually have to be part of the json format? Or should it perhaps be separate?

Asking mainly because I have a project that only needs dynamic handling, and it might be overkill to pull in all the machinery behind "real" JSON support

@sandwwraith
Copy link
Member

@ankushg Well, since JSON is a JavaScript Object Notation, javascript's dynamic objects can be mapped on it really well. It allows us to provide first-class support for features like object-based polymorphism and interopability with JsonElement, so it's an important part.

@ankushg
Copy link
Contributor

ankushg commented Oct 29, 2020

@sandwwraith definitely! My question was really if it was possible to put this in core instead of json, since dynamic is really just part of the JS language itself (as opposed to parsing JSON-formatted Strings or JsonElements, which are more external).

Right now you have to pull in the machinery that handles everything related to JsonElements just to get support for the built-in dynamic type.

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.

None yet

3 participants