Skip to content

Document definition format #56

@Saiv46

Description

@Saiv46

There's no single ProtoDef format enforced by this spec. Projects use either JSON and PDS (ProtoDef Spec) which have own pros and cons (comments, complicated syntax, lack of support).

I propose to replace both of them with HJSON, which already have libraries in many languages.

Example PDS:

@doc "A composite data structure which contains 3 fields."
def("position") => container {
    field("x") => ::f64;
    field("y") => ::f64;
    field("z") => ::f64;
};

Example JSON:

{
  "position": [
    "container",
    [
      { "name": "x", "type": "f64" },
      { "name": "y", "type": "f64" },
      { "name": "z", "type": "f64" }
    ]
  ]
}

Example HJSON:

{
  // A composite data structure which contains 3 fields.
  position: [
    container
    [
      { name: x, type: f64 },
      { name: y, type: f64 },
      { name: z, type: f64 },
    ]
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions