23andMe / Yamale

A schema and validator for YAML.
MIT License
666 stars 88 forks source link

More information on "invalid syntax" at `$id` #242

Open koppor opened 5 months ago

koppor commented 5 months ago

I am trying to use https://github.com/citation-file-format/citation-file-format/blob/main/schema.json with following file:

authors:
  - family-names: Druskat
    given-names: Stephan
cff-version: 1.2.0
message: "If you use this software, please cite it using these metadata."
title: "My Research Software"

(Source: https://github.com/citation-file-format/citation-file-format/blob/79290ebbc3ba8595b92ab323aff7f01c8a5965af/schema-guide.md#minimal-example)

When running the validator ( yamale.exe -s schema.json cff.yaml), I get

Schema error in file C:\TEMP\x\schema.json
Invalid schema expression: 'https://citation-file-format.github.io/1.2.0/schema.json'. invalid syntax (<unknown>, line 1) at node '$id'

Doesn't JSON Schema allow URLs in $ids?

According to JSON Schema, this is allowed in Draft 6 (https://json-schema.org/understanding-json-schema/basics#declaring-a-unique-identifier)

koppor commented 5 months ago

Maybe, later JSON Schema drafts are not supported?

"$schema": "http://json-schema.org/draft-07/schema",
Invalid schema expression: 'http://json-schema.org/draft-07/schema'. leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers (<unknown>, line 1) at node '$schema'