Skip to content

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

@shanshin shanshin force-pushed the json-js-object-poly-835 branch from dad1934 to cb83664 Compare October 20, 2020 14:15
…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
@shanshin shanshin force-pushed the json-js-object-poly-835 branch from cb83664 to 6f9483f Compare October 21, 2020 14:36
@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.

4 participants