Skip to content

bug: handlers object in schema.json is incorrectly defined as array #733

@mattmess1221

Description

@mattmess1221

Description of the bug

The schema.json is accidentally defining the handlers property as an array (via items), causing schema validation to fail or stop suggesting properties.

To Reproduce

Reproduction:

# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json

plugins:
  - mkdocstrings:
      handlers:
        python:
          # no auto-completion

Changing the handlers object to an array fixes validation, but this should be invalid.

# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json

plugins:
  - mkdocstrings:
      handlers:
        - python:
            # auto-completion works

Full traceback

N/A

Additional context

The handlers object is currently defined via

"handlers": {
"title": "The handlers global configuration.",
"markdownDescription": "https://mkdocstrings.github.io/handlers/overview/",
"type": "object",
"default": null,
"items": {
"oneOf": [
{
"$ref": "https://raw.githubusercontent.com/mkdocstrings/python/master/docs/schema.json"
}
]
}

I would suggest this change, removing the items key.

"handlers": {
  "title": "The handlers global configuration.",
  "markdownDescription": "https://mkdocstrings.github.io/handlers/overview/",
  "allOf": [
    {
      "$ref": "https://raw.githubusercontent.com/mkdocstrings/python/master/docs/schema.json"
    }
  ]
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions