Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update handlers in schema.json to be an object instead of array #734

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

mattmess1221
Copy link
Contributor

Also changes oneOf to anyOf for more potential handlers in the future.

Fixes #733

@mattmess1221 mattmess1221 changed the title fix: Update schema.json to be an object instead of array fix: Update handlers in schema.json to be an object instead of array Feb 3, 2025
Also changes `oneOf` to `anyOf` for more potential handlers in the future.

Fixes mkdocstrings#733
@pawamoy
Copy link
Member

pawamoy commented Feb 3, 2025

Thanks a lot! Just to be sure, anyOf will support having multiple handler keys right? Like:

plugins:
- mkdocstrings:
    handlers:
      python: ...
      rust: ...

docs/schema.json Outdated Show resolved Hide resolved
master -> main

Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
@mattmess1221
Copy link
Contributor Author

mattmess1221 commented Feb 3, 2025

Yes, oneOf means exactly one while anyOf means at least one.

Ref: https://json-schema.org/understanding-json-schema/reference/combining

allOf may also work if none of the target schemas has any required keys.

Copy link
Member

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you very much!

@pawamoy pawamoy merged commit 3cf7d51 into mkdocstrings:main Feb 3, 2025
26 checks passed
@mattmess1221 mattmess1221 deleted the fix/handler-schema branch February 3, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: handlers object in schema.json is incorrectly defined as array
2 participants