Config JSON Schema - 2026-10-22¶
Context¶
qasight.yaml had no JSON Schema, so editors could not suggest its keys or flag a typo such as worker: until qasight config validate ran. Most YAML-driven tools ship one; editors with a YAML language server (VS Code's Red Hat YAML extension, JetBrains, Neovim) load it from a URL or a # yaml-language-server: $schema=... line.
Decision¶
qasight/config/json_schema.pybuilds a draft-07 schema from the constants inqasight/config/schema.py(SUPPORTED_FRAMEWORKS,SUPPORTED_TIERS,SUPPORTED_REPORTER_TYPES,Defaults). The loader stays the source of truth for what loads; the schema mirrors the keysqasight/config/loader.pyreads.scripts/export_config_schema.pywrites it toschema/qasight.schema.json. CI runs it with--check, the same wayexport_openapi.pyguardsfrontend/openapi.json. Editors load it fromhttps://raw.githubusercontent.com/arieleven/qasight/main/schema/qasight.schema.json.qasight config initandqasight initwrite the$schemaline at the top of the file, and the repo's own configs point at the file by relative path.equipment,frameworkand reportertypesuggest the built-in names but accept any string, because plugins add their own. Unknown keys on the top level,defaults, cycles and stages are errors, which is what catches typos. Reporter entries allow any key, since those are reporter options.- Only the canonical
cycles:layout is described. Legacyplans:andruns:still load, but the schema flags them.
Options considered¶
- Generate from the dataclasses. Rejected: the dataclasses are the loaded form, not the YAML. YAML has
equipment,ifandargsas a string or list; the dataclasses haveframework,if_exprand a tuple. - Switch the loader to Pydantic and use its schema. Rejected for now: a rewrite of the loader for a small editor feature.
- Submit to SchemaStore. Tried and declined for now: SchemaStore/schemastore#6546 (2026-10-24) was closed by a maintainer, who said space in the catalog is limited and to open a new PR once the tool is widely used. A duplicate opened by mistake on 2026-10-26 (#6552) was closed the same day. Until then, editors need the
$schemaline, whichqasight config initandqasight initalready write.
Consequences¶
- A new loader key needs a matching schema entry.
tests/contract/qasight/test_config_json_schema.pyvalidates the repo's configs and the starter template against the schema, checks a set of invalid configs are flagged, and fails if the committed file is stale. - The schema URL follows
main, so a key added onmainshows up in editors before it is on PyPI.