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

Extensions #107

Closed
ikeough opened this issue Feb 25, 2019 · 0 comments
Closed

Extensions #107

ikeough opened this issue Feb 25, 2019 · 0 comments
Labels
Enhancement New feature or request JSON Issues related to serialization to and from JSON.
Milestone

Comments

@ikeough
Copy link
Contributor

ikeough commented Feb 25, 2019

Authors of libraries which include types that extend Element need a way to serialize and deserialize those types to/from JSON. Currently, an attempt to deserialize a type which extends Element fails because the type can't be found using the current lookup in the executing assembly. This is noted in #104.

The authors of glTF have a nice solution for this, which I think we should adopt. KhronosGroup/glTF#404, although with some modifications. glTF extensions allow extension at the property level. I think we should only allow extension at the type level (for now).

A model created using an extension library would need to declare its extensions. Perhaps like:

{
  "extensions":["foo.bar.baz"]
}

Upon deserialization, the deserializer will check whether there is a foo.bar.baz assembly loaded in the domain. If so, it will attempt to deserialize, using the foo.bar.baz assembly (instead of just using the executing assembly as is done currently.).

If an attempt is made to deserialize using an extension that is not available, deserialization should fail with a message like

Attempted to deserialize a model created using the foo.bar.baz extension, which is not currently available in the application domain.
@ikeough ikeough added this to the 0.2.1 milestone Feb 25, 2019
@ikeough ikeough added Enhancement New feature or request JSON Issues related to serialization to and from JSON. labels Feb 28, 2019
This was referenced Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request JSON Issues related to serialization to and from JSON.
Projects
None yet
Development

No branches or pull requests

1 participant