Skip to content

v0.31.0

Choose a tag to compare

@github-actions github-actions released this 24 Nov 23:21
· 18 commits to main since this release
998d05e

The fork's seventh stable release, from the same commit as v0.31.0-rc.1.

Compared with v0.30.0, a package that --schema-package gives an alias is now declared under that alias in its own files too. The README lists every difference from upstream.

  • --schema-package URI=PACKAGE:ALIAS, and SchemaMapping.ImportAlias in the library, named the package only where other files import it. The files generated into the package kept declaring the last segment of its path, so import headerv1 ".../header/v1" met package v1. Go compiles that, but a check that package names follow a convention, such as headerv1 for a versioned directory, failed on the generated files, and a run that generates several packages had no other way to name them. Now every file generated into the package declares the alias: also the file of a mapping into the same package that sets no alias, and the default package's file when a mapping gives that package an alias. Without an alias, the name is still the path's last segment, and the code is the same as before.
  • Since the alias names the package, main and documentation are refused as aliases: a package named main can't be imported, and the go command skips the files of a package named documentation.

Behaviour change: where an alias differs from the path's last segment, the generated package is now declared under the alias. Code that imports it without an alias and writes v1.Header has to write headerv1.Header, and hand-written files beside the generated ones have to declare package headerv1. Generated code checks documents as v0.30.0 does: no new rejections.

Built with Go 1.26.11, and checked with govulncheck before it was published.

Changelog

  • 9aaa032 Merge pull request #80 from plheide/docs/readme-image-tag-v030
  • 998d05e Merge pull request #81 from plheide/fix/declared-package-name-from-alias
  • 1c17340 docs(cross-tree): say that an alias names every file of its package
  • b164d48 docs(fork): name v0.30.0 in the container image example
  • acff456 fix(cross-tree): declare a mapped package by its import alias
  • 4223a4d fix(cross-tree): refuse main and documentation as import aliases