Skip to content

feat: add $schema to properties to allow using the schema file for JSON config validation - #4

Open
guillemc23 wants to merge 3 commits into
DL4EO:mainfrom
guillemc23:feat/config-schema
Open

guillemc23 wants to merge 3 commits into
DL4EO:mainfrom
guillemc23:feat/config-schema

Conversation

@guillemc23

Copy link
Copy Markdown

Adding $schema as a property allows using this file as a validator in VS Code or other IDEs that support this.

When setting $schema at the top of any configuration file, the IDE will show a tooltip with the documentation from the defined schema as in the pic below:

If $schema is not added into the properties, this is not possible 😃

@jeffaudi

jeffaudi commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Two repo checks will fail as the pull request stands:

  • Vendored copy is stale. configs/config.schema.json and oriented_det/configs/config.schema.json are the same file today. This pull request edits only the first. CI runs make check-configs, which requires them to match.
    --> run make sync-configs and run check-configs test locally

  • The alignment test will fail. test_config_schema_fieldnames_align_with_dataclasses in tests/test_training_config_strict.py requires schema property names to match dataclass field names, with base as the only exception. The schema key is $schema and the field is schema, so both sides of that assertion fail. The test allowlist has to treat that pair the way it treats base.
    --> please add a small load/save test: a config with $schema loads, to_dict() round-trips the key, and a config without it does not gain one.

This branch has not been deployed

No deployments
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.

2 participants