w3c / mnx

Music Notation CG next-generation music markup proposal.
179 stars 18 forks source link

Lyrics basic and lyrics multi-line examples do not validate against the schema. Lyrics multi-line example syntax error. #358

Closed paul-bayleaf closed 2 days ago

paul-bayleaf commented 4 weeks ago

There are two issues here:

1) Lyrics basic and lyrics multi-line examples do not validate against the schema.

The schema for the "lyrics" property "lines" will need to use "patternProperties" to allow a user specified property name. For example.

    "lyrics": {
      "additionalProperties": false,
      "properties": {
        "lines": {
          "additionalProperties": false,
          "patternProperties": {
            "^.*$": {
              "additionalProperties": false,
              "properties": {
                "text": {
                  "$ref": "#/$defs/string"
                },
                "type": {
                  "enum": [
                    "start",
                    "middle",
                    "end",
                    "whole"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "text"
              ],
              "type": "object"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },

2) Lyrics multi-line example syntax error.

The lyrics multi-line example on line 90 has "hyphen": "start" this should be "type": "start".

adrianholovaty commented 2 days ago

@paul-bayleaf Thanks very much! Both of these are now fixed:

The latter was made possible by an improvement to the docs system (commit here).

A related note is: I've just added a way to quickly run the JSON Schema validation on all of the example documents from the command line (commit here). This is done via python manage.py validate_json.