Repository navigation
v0.30.0
The fork's sixth stable release, from the same commit as v0.30.0-rc.2.
Compared with v0.29.0, it checks more of what conditionals, not and dependentRequired declare, and warns about keywords beside a $ref. The README lists every difference from upstream.
New checks, which reject input that v0.29.0 accepted, with default flags:
- A conditional
allOfkeyed on a discriminator compiles each branch keyword by keyword. Athenorelsechecks itsrequired, anotofrequired, and any property it narrows to some strings with aconstor anenum, whatever else it declares. A warning names the rest. Before, one branch that could not compile whole left the object with no conditional check at all. Athenorelsewith a$refstill checks nothing, since draft-07 ignores the keywords beside a$ref. Schemas whose branches all compiled before generate the same code. - An object's own
notofrequiredis checked, as are thenots of itsallOf.not: {required: [a, b]}forbids having both properties, andnot: {anyOf: [{required: [a]}, {required: [b]}]}forbids having either. dependentRequired, and the property lists of draft-07'sdependencies, are checked where the draft the document declares defines the keyword: 2019-09 broughtdependentRequiredand droppeddependencies. A document that declares no draft has both checked, merged per property where an object declares both.
Rejected now:
- a property that a compiled branch requires and the document lacks;
- a narrowed property outside its values;
- a set of properties that a
notforbids; - a property that
dependentRequired, or the lists ofdependencies, ask for.
Warnings:
- Keywords beside a
$refapply from 2019-09 on, but the type generated for the$refis its target's. A warning now names them, except in documents that declare draft-07 or earlier, which ignore them as well. - A keyword that the declared draft does not define is named so, as in
unevaluatedProperties (not in draft-07) not checked. - Warnings name a draft-07
dependenciesas written, where they named the 2019-09 keyword it is read as. Where its lists are checked, the warning names the properties whose schemas are not, as independencies (zip) not checked.
Fixes:
- A
$refinto thedependenciesof a schema that also declaresdependentSchemasfinds its own schema, where it found thedependentSchemasentry of the same name.
Built with Go 1.26.11, and checked with govulncheck before it was published.
Changelog
- 15cf85a Merge pull request #77 from plheide/docs/readme-image-tag-v029
- 85f7a25 Merge pull request #78 from plheide/fix/v030-presence-checks
- c4fa342 Merge pull request #79 from plheide/fix/v030-dependencies-beside
- 296fdbf docs(fork): list the changes made on main for v0.30.0
- d13aebd docs(fork): name v0.29.0 in the container image example
- cd8fd3f fix(conditional): compile each branch keyword by keyword, and narrowed enums
- 1eb3867 fix(dependencies): read a draft-07 dependencies beside dependentRequired
- bb77ce1 fix(dependentRequired): check dependentRequired and draft-07's property dependencies
- b73d683 fix(fidelity): quote "not" when naming what a branch leaves unchecked
- e90cf99 fix(fidelity): report $ref siblings on the alias path and in nested allOf branches
- 67639b1 fix(fidelity): warn about keywords beside a $ref, and name a keyword's draft
- 4dc17a3 fix(not): check an object's own not of required, and an allOf of them
- a47bc87 test(differential): leave subschemas with their own $schema out of the draft search
- 83fb2d8 test(differential): read an undeclared schema that uses 2019-09 keywords as 2020-12
- 0f9a6b4 test(differential): read such schemas as 2019-09, through subschemas only