bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

JSON schema for output with the `--json` option

Open candleindark opened this issue 6 months ago • 0 comments

Since the goal of the --json option is to make the validation results machine readable, it seems to me that the validator can benefit from having a JSON schema published for its output with the --json option. It's the same benefit that a web API gains from having an OpenAPI schema.

In working with the JSON output of the validator, currently, I need to code up models based on analysis of models (and related models) defined in https://github.com/bids-standard/bids-validator/blob/main/src/types/validation-result.ts. On the other hand, if a JSON schema for JSON output is available, the models I am current coding can be automatically generated using tools such as https://koxudaxi.github.io/datamodel-code-generator/.

I can think two ways to make the JSON schema available:

  1. Publishing it in a separate repo
  2. Dedicating a subcommand in the validator for generating the JSON schema

candleindark avatar Apr 01 '25 22:04 candleindark