include $schema version declaration in json schema exports#1359
Closed
gwennlbh wants to merge 1 commit intoarktypeio:mainfrom
Closed
include $schema version declaration in json schema exports#1359gwennlbh wants to merge 1 commit intoarktypeio:mainfrom
gwennlbh wants to merge 1 commit intoarktypeio:mainfrom
Conversation
9357e30 to
6eec177
Compare
gwennlbh
added a commit
to cigaleapp/cigale
that referenced
this pull request
Mar 9, 2025
Author
|
It might be worth using draft-07 instead, VS Code warns me on unsupported features (namely "$dynamicRef" i believe) for newer versions |
Member
|
Hey thanks so much for this PR it was very useful! I'm updating the |
gwennlbh
added a commit
to cigaleapp/cigale
that referenced
this pull request
Jun 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
I noticed that the exported JSON Schema object does not include the
$schemakey, which declares the meta schema (and thus declares which version of JSON schema this is intended to be used with)I used the latest version and hardcoded the string, it might be worth factoring out
In order to only add the $schema key at the top-level, I added a new
.toJsonSchemaNoVersionmethod that does what.toJsonSchemadid beforeI wonder if the usages of .toJsonSchema could be replaced with .innerToJsonSchema so we don't have to add a new method?
I also tried putting the version inclusion as an optional argument to .toJsonSchema, but it seems like my typescript powers are not strong enough yet, I get a type error at the Object.assign call when doing
Thanks a lot for this project, it's really impressive and the DX is great :3