BIDS Standard Metaschema Illegal Definitions

The BIDS metaschema uses nested hierarchy in the definitions/$defs section. For example, under enums , we have formats and requirement_level.
However, I believe this is illegal for JSON schema.

In the JSON schema specification 8.2.4, it requires

Each member value of this object MUST be a valid JSON Schema.

As such, I believe enums and ruleTypes in the metaschema should be flattened.

Additionally, since JSON schema 2019-09 the keyword $defs should be preferred over definitions.

Possibly. I don’t think any of us claim to be JSON-schema experts. What we have validates the BIDS schema, which is what it was written for. Feel free to open a PR to make it more compliant with modern JSON schema. Note that one of the things it’s used for is generating typescript types (https://jsr.io/@bids/schema/1.1.0/metaschema.ts), so we will need to make sure that continues to work or we find an alternative tool.