Sitelet https://github.com/ubjson/universal-binary-json/issues/84
Skip to content

PROPOSAL - Template Support #84

Description

@rkalla

For those that have been around a long time, you know this discussion started in 2013 and never ended - primarily due to my inability to become comfortable with any of the proposal... especially my own :)

I've been mulling this over on and off for the last 2 years more than usual and it was always the intersection between simplicity and consistency with the existing spec that didn't quite click for me.

With that said, I would like to make the following proposal and see how it tastest/feels/smells to the rest of the community.

  • [_][integer length][0 or more data-type markers] (e.g. [i][S][C])
  • no container markers allowed in the template definition
  • can occur 0 or more times inside of a container
  • additional complexity in the parsers would be to check the 1st byte value after all expected structured data was read to see if it was 95 (another _ marker)
  • In the case of [S] or [H], only the type marker is specified and the length will be pefixed down in the data payload; similar to how Object containers are defined to omit the [S] off the name portion of the entries.

Example:

[{]
  [_][i][3][S][C][i]
  [i][5][frank][Y][3]
  [i][4][mary][P][9]
  [i][7][dillion][J][13]
  [i][7][willard][W][22]
  [i][3][bob][V][11]
  [_][i][2][i][d]
  [7][3.14]
  [13][2.18]
[}]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions