JetBrains / web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
Apache License 2.0
279 stars 25 forks source link

Vue directive (attribute): missing definition field for directive `:argument` #7

Closed tmorehouse closed 4 years ago

tmorehouse commented 4 years ago

Directives have the following syntax:

v-name:argument.modifier1.modifier2.modifierN="expression"

In the schema, I see that it is possible to define the directive's name, modifiers and expression (value), but there is no mention of the argument (which follows the :, before any modifiers)

So how does one document the argument?

    "html-attribute": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/definitions/name"
        },
        "description": {
          "$ref": "#/definitions/description"
        },
        "doc-url": {
          "$ref": "#/definitions/doc-url"
        },
        "default": {
          "$ref": "#/definitions/html-attribute-default"
        },
        "required": {
          "$ref": "#/definitions/html-attribute-required"
        },
        "value": {
          "$ref": "#/definitions/html-attribute-value"
        },
        "source": {
          "$ref": "#/definitions/source"
        },
        "vue-modifiers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/named-entity"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
piotrtomiak commented 4 years ago

@tmorehouse not yet possible. Another thing to add to the spec. I should be able to see to all the problems tomorrow.

piotrtomiak commented 4 years ago

@tmorehouse What would you like to document about argument? As far as I understand it could be string representing anything. Do you think about some pattern matching or HTML references, similarly to modifiers, or is it just about having a description?

tmorehouse commented 4 years ago

Mainly the description for the argument (although pattern matching would be optionally good). In our case the argument part of the directive is typically an HTML Element ID.

piotrtomiak commented 4 years ago

Web-types schema has been updated.