Repository navigation
The fork's eighth stable release, from the same commit as v0.32.0-rc.1.
Compared with v0.31.0, an anyOf or oneOf of listed strings becomes one enum, a oneOf of objects that $refs name is tried variant by variant, any number of packages that another run writes can be left unwritten, and unevaluatedProperties is checked beside branches that evaluate no property. The README lists every difference from upstream.
- An
anyOforoneOfwhose branches only list strings, withconstorenum, inline or through a$ref, is an enum of the strings it admits: those that a branch of theanyOflists, and those that just one branch of theoneOflists. Before, such ananyOfwasinterface{}, unchecked, and such aoneOfwas reported as not compiled. A branch that admits onlynullmakes the field a pointer. A conditional that narrows a property through a$refto such an enum is checked as one that narrows it with an inline enum is. - A
oneOfof objects that$refs name, with noconstto tell them apart, gets a holder that tries each variant, as one of inline objects did; so does one with a variant built with anallOf. Before, it wasinterface{}, reported as not compiled. A variant closed withunevaluatedProperties: falsecounts as closed. AoneOfwith a variant whosenot,if/then/elseordependentSchemasits type cannot check is left as it was, since a valid value could decode as two variants: this now holds for inline variants too, which were tried before. --schema-output URI=, with no file name, writes nothing for the schema: its types are in a package that another run writes, and the files that refer to them import it. Any number of packages can be left so; a second one failed before. Both runs must name the package's types alike, which they do when they generate the same schemas into it in the same order.- Under
--strict-additional-properties,unevaluatedProperties: falseis checked beside ananyOf,oneOf, conditional ordependentSchemaswhose subschemas evaluate no property, such as branches that only listrequired, and beside anot. - A discriminated
oneOfof$refs in a 2019-09 or later document no longer warns that each variant has other keywords beside its$ref.
New rejections, with default flags: a string that an enum union does not list; an object that matches no variant, or more than one, of a oneOf of $ref'd objects; a narrowed property outside the enum that its $ref names. Under --strict-additional-properties, also a property that an object closed with unevaluatedProperties: false does not declare, beside the keywords above.
Changed types: fields that were interface{} become enums or holders. An anyOf of an enum and a map or array of it takes its first typed branch's type, as before; where the enum was an untyped oneOf of consts, that was the container, and now it is the enum. A oneOf whose inline variant has a not that its type cannot check is interface{} instead of a holder.
Built with Go 1.26.11, and checked with govulncheck before it was published.
Changelog
- b8ff985 Merge pull request #82 from plheide/docs/readme-image-tag-v031
- c99a245 Merge pull request #83 from plheide/fix/v032-unions-and-ref-variants
- a5d8310 docs(fork): name v0.31.0 in the container image example
- e44f9f9 feat(enum-union): generate an anyOf or oneOf of listed strings as one enum
- 614ed1f fix(cross-tree): write nothing for any number of unwritten packages
- 9aee09c fix(enum-union): keep a type of string beside the union from admitting null
- 84b933f fix(oneof): keep a closed variant's shape to the properties it evaluates
- e56248c fix(oneof): stop at an allOf that leads back to itself
- 9b58cfd fix(oneof): try each variant of a oneOf of objects that $refs name
- d06dd42 fix(unevaluated): check unevaluatedProperties beside branches that evaluate none
- c8a12bd test(unevaluated): say that the presence-keyed conditional stays unchecked