A proposal to remove or update the variant extension #30
stephenberry
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
BEVE is supposed to be schema-less, and allow users to come to a BEVE file and draw all the needed information from the document itself. The variant extension violates this design principle. Using an index without describing possible types means that a schema is required to know what index relates to what type.
This violation of the schema-less design in BEVE breaks working with variants/unions in JSON. In JSON the typical approach is to use another key like
"tag"to indicate the type of data in the object.BEVE variants could use a string tag rather than an integer, and this would be an improvement, but when translated to JSON what would the key be? Forcing a particular JSON key for deduction is not flexible. And, anyone who implements variant handling in JSON and switches to BEVE would probably want to use the same mechanisms to choose the type of the BEVE. This recommends variant handling to be accomplished within BEVE objects. If BEVE were to declare a key to for JSON equivalence this would cause code to need to add this field to JSON documents for equivalence, but I think we want to avoid defining hard JSON equivalence for special functionality like variants.
BEVE needs to think about how data is described in JSON.
All reactions