unicode-org / message-format-wg

Developing a standard for localizable message strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEEDBACK] Mistake in JSON schema

bhaible opened this issue · comments

This definition in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model/message.json makes no sense:

    "function-annotation": {
      "type": "object",
      "properties": {
        "type": { "const": "function" },
        "name": { "type": "string" },
        "options": { "$ref": "#/$defs/options" }
      },
      "required": ["type", "kind", "name"]
    },

The required line does not list the property options (why should an array be optional?) and references another property kind.

Suggestion: Replace

      "required": ["type", "kind", "name"]

with

      "required": ["type", "name", "options"]

Thanks. The options property remains optional; fine with me.

That's by design. From the data-model intro:

Note that while the data model description below is the canonical one, the JSON and DTD definitions are intended for interchange between systems and processors. To that end, they relax some aspects of the data model, such as allowing declarations, options, and attributes to be optional rather than required properties.