-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Give the bug a title
Lint: unknown keywords w/o x-
prefix and $ref
siblings in biomaterial_core.json
To reproduce
Steps to reproduce the behavior:
-
From the repo root, install the JSON Schema linter CLI:
npm i -g @sourcemeta/jsonschema
(or use npx). -
In
json_schema/core/biomaterial/
, run:jsonschema lint ./
-
Observe warnings for
unknown_keywords_prefix
across multiple fields and adraft_ref_siblings
warning.
Schema versions
biomaterial_core.json
schema v8.4.0
Observed behavior
The @sourcemeta/jsonschema cli shows these errors/warnings
$ jsonschema lint ./
biomaterial_core.json:10:13:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/name"
biomaterial_core.json:83:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/HDBR_accession/user_friendly"
biomaterial_core.json:37:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/biomaterial_description/user_friendly"
biomaterial_core.json:27:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/biomaterial_id/user_friendly"
biomaterial_core.json:32:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/biomaterial_name/user_friendly"
biomaterial_core.json:67:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/biosamples_accession/user_friendly"
biomaterial_core.json:51:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/genotype/user_friendly"
biomaterial_core.json:75:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/insdc_sample_accession/user_friendly"
biomaterial_core.json:45:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/ncbi_taxon_id/user_friendly"
biomaterial_core.json:22:24:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/schema_version/example"
biomaterial_core.json:60:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/supplementary_files/user_friendly"
biomaterial_core.json:88:28:
In Draft 7 and older dialects, keywords sibling to `$ref` are never evaluated (draft_ref_siblings)
at schema location "/properties/timecourse/description"
biomaterial_core.json:91:30:
Future versions of JSON Schema will refuse to evaluate unknown keywords that don't have an x- prefix (unknown_keywords_prefix)
at schema location "/properties/timecourse/user_friendly"
Expected behavior
Ideally there should not be any linting errors in the schema. We can fix it with jsonschema lint {file/dir} --fix
Screenshots or Messages

Note
For context, I, along with Juan (JSON Schema TSC member) are defining linting rules for JSON Schema as a Part of a GSoC (Google Summer of code) project here - https://github.com/Karan-Palan/JSON-Schema-Linting, and implementing their auto-fixes here - https://github.com/sourcemeta/jsonschema/blob/main/docs/lint.markdown. We have recently added many rules prefixing unknown keywords with x-
which will be introduced in the newer JSON Schema drafts
If beneficial to the project, I suggest integrating the complete cli with it to write the best schemas and catch any errors and follow best practices. Examples of integration - https://github.com/krakend/krakend-schema/blob/main/.github/workflows/validate-json-schema.yml#L10
You can find the health of schemas here:
