Skip to content

v0.30.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 21:15
· 24 commits to main since this release
c4fa342

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 allOf keyed on a discriminator compiles each branch keyword by keyword. A then or else checks its required, a not of required, and any property it narrows to some strings with a const or an enum, 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. A then or else with a $ref still 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 not of required is checked, as are the nots of its allOf. not: {required: [a, b]} forbids having both properties, and not: {anyOf: [{required: [a]}, {required: [b]}]} forbids having either.
  • dependentRequired, and the property lists of draft-07's dependencies, are checked where the draft the document declares defines the keyword: 2019-09 brought dependentRequired and dropped dependencies. 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 not forbids;
  • a property that dependentRequired, or the lists of dependencies, ask for.

Warnings:

  • Keywords beside a $ref apply from 2019-09 on, but the type generated for the $ref is 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 dependencies as 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 in dependencies (zip) not checked.

Fixes:

  • A $ref into the dependencies of a schema that also declares dependentSchemas finds its own schema, where it found the dependentSchemas entry 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