Skip to content

Releases

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 21:39
124e9c1

Highlights

  • AsyncAPI 3.x parameter enums. A channel parameter's own enum now makes it a Go type, as schema.enum did. schema is the AsyncAPI 2.x form, which asyncapi validate rejects in a 3.x document, so valid 3.x specs used to get a plain string. The names are unchanged: jobType with enum: [build, deploy] gives type JobType string with JobTypeBuild and JobTypeDeploy. Regenerate: parameters with an enum change from string to the enum type in the Send and Subscribe signatures.
  • Pattern parameters the 3.x way. x-aapi-codegen: {pattern: '…'} on a parameter gives the pattern type, with NewX and MustX. A parameter's schema is still read, with a warning that names the 3.x form. A parameter that declares its own enum or x-aapi-codegen.pattern ignores its schema, and the warning says so.
  • Checked parameter values. Enum and pattern types get a Valid() method, and an enum a <Type>Values() function that lists its values. Since a conversion such as JobType("x") compiles, every Send and Subscribe method checks its typed parameters first. A value outside its type returns an error, such as parameter jobType: "x" is not a valid JobType, and nothing is published or bound. With omit-validation, nothing is checked.
  • go-jsonschema v0.32.0 (v0.12.1 used v0.30.0). An anyOf or oneOf of listed strings becomes an enum, and a oneOf of $ref'd objects decodes variant by variant; both were interface{}. unevaluatedProperties: false is also checked beside branches that evaluate no property. Since v0.31.0, a schema-packages alias of main or documentation is refused.
  • The binaries are built with Go 1.26.11, as before. Specs without typed parameters generate the same code as with v0.12.1.

All changes: v0.12.1...v0.13.0.

Changelog

  • 5e965b2 Merge pull request #23 from plheide/dependabot/github_actions/github-actions-8aadb2d7d5
  • 124e9c1 Merge pull request #24 from plheide/feat/v0.13.0-typed-parameters
  • b41a421 build: move to go-jsonschema v0.32.0
  • e6d7aa6 ci(deps): bump actions/setup-go
  • f1ea5ac feat: check typed parameters in Send and Subscribe
  • 4fad9e6 feat: take a parameter's pattern from x-aapi-codegen, warn about schema
  • 7fe8bd3 feat: type a channel parameter from its AsyncAPI 3.x enum
  • 66c0f89 fix: let a parameter's own enum or pattern win over its schema

v0.12.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 23:00
0e0a8ca

Highlights

  • Keywords beside a message payload's own $ref, such as required, now print a warning, as go-jsonschema warns about keywords beside a $ref everywhere else. They are still ignored. For example:

    aapi-codegen: warning: schema fidelity: channels.orders.messages.OrderPlaced.payload does not enforce all it declares: required beside $ref not checked
    
  • A payload schema that is itself a $ref to another schema, such as a components.schemas entry that only refers to another one, gave code that used a type declared nowhere, so it didn't compile. The generator now stops with an error that says to point the payload's $ref at the other schema. A $ref to a schema of the same title works as before.

  • examples/use-aapi-codegen.sh: AAPI_CACHE is now the cache root, with a directory per version, so a custom AAPI_CACHE no longer keeps returning the first version's binary after AAPI_VERSION changes. The default cache path is unchanged. A custom AAPI_CACHE that already ended in the version gets one more level, and one more download.

  • Payload types still come from go-jsonschema v0.30.0, and the binaries are built with Go 1.26.11. Every spec in the test suite generates the same code as with v0.12.0.

All changes: v0.12.0...v0.12.1.

Changelog

  • 0e0a8ca Merge pull request #22 from plheide/fix/payload-ref-and-script-cache
  • 3c96e69 feat: warn about keywords beside a message payload's own $ref
  • 840c365 fix(examples): keep one binary per version under a custom AAPI_CACHE
  • fce49f0 fix: stop with an error when a payload schema is a $ref

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 22:28
76c7955

Highlights

  • Payload types come from go-jsonschema v0.30.0; v0.11.0 used v0.29.0. Generated code checks more of what a payload declares, so it can reject messages that v0.11.0 accepted:
    • dependentRequired, and the property lists of draft-07's dependencies: where a property is present, the properties it lists must be too. A schema file that declares its draft gets the keyword that draft defines; one that declares none, like an inline payload, gets both;
    • a not of required: not: {required: [a, b]} forbids having both;
    • an if/then/else keyed on one property's const or enum checks each branch keyword by keyword. Before, one branch that couldn't compile whole left the object with no conditional check.
  • Keywords beside a $ref are still ignored, but they now print a warning, except in a schema file that declares draft-07 or earlier. Keywords beside a message payload's own $ref are still dropped without one. Put them in an allOf beside the $ref instead.
  • The release binaries are built with Go 1.26.11, as v0.11.0's were.
  • Every spec in the test suite generates the same code as with v0.11.0, except the validationservice fixture, whose payload gained the new keywords.

All changes: v0.11.0...v0.12.0.

Changelog

  • 76c7955 Merge pull request #21 from plheide/build/go-jsonschema-v0.30.0
  • 7291e8d build: move to go-jsonschema v0.30.0

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 18:39
6e7aa43

Highlights

  • Payload types come from go-jsonschema v0.29.0; v0.10.0 used v0.28.0:
    • an allOf member that schema-packages maps to another package no longer leaves that package imported and unused, which made the generated file fail to build;
    • unevaluatedProperties: false is checked, as additionalProperties: false is: a key that no allOf member declares is rejected.
  • go-jsonschema's warnings are printed to stderr as aapi-codegen: warning: … instead of being discarded, for example when the generated code doesn't check a keyword such as minProperties. The file is still written and the exit status is unchanged. Library callers get them through Config.Warn.
  • The release binaries are built with Go 1.26.11, which fixes GO-2026-6859.
  • Every existing spec in the test suite generates the same code as with v0.10.0.

All changes: v0.10.0...v0.11.0.

Changelog

  • 6e7aa43 Merge pull request #20 from plheide/build/go-jsonschema-v0.29.0
  • 8dd858d build: move to go-jsonschema v0.29.0
  • 14f92b6 ci: build with Go 1.26.11
  • 5441430 feat: print go-jsonschema's warnings instead of discarding them

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 21:19
a703e8d

Highlights since v0.9.0

  • Fix: a queue name that uses the channel address's parameters but differs from the address, such as {tenant}.audit-log on {tenant}.orders.created, was generated as the literal "{tenant}.audit-log". It's now built from the Subscribe arguments, as the routing key is. A parameter the address lacks stops the generator.
  • Payload types come from go-jsonschema v0.28.0; v0.9.0 used v0.26.0. Regenerate and review the diff:
    • format: duration is a types.Duration, written as ISO 8601 such as PT1H30M and read from that or from a number of nanoseconds; it was a time.Duration;
    • a primitive anyOf or oneOf that lists values keeps its type and is checked;
    • a required array or object left nil is written as [] or {}, not null;
    • the values inside arrays and maps are checked, and so is uniqueItems;
    • integers written as 2.0 decode, and a const property gets a constant.
  • Three of the test suite's specs change, only in those ways.

All changes: v0.9.0...v0.10.0.

Changelog

  • a703e8d Merge pull request #19 from plheide/build/go-jsonschema-v0.28.0
  • bb4e96f build: move to go-jsonschema v0.28.0

v0.10.0-rc.1

v0.10.0-rc.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 19:30
6c81f7f

Highlights

  • Fix: a queue name that uses the channel address's parameters but differs from the address, such as {tenant}.audit-log on {tenant}.orders.created, was generated as the literal string "{tenant}.audit-log", so the subscriber read from the wrong queue. It's now built from the Subscribe arguments, as the routing key is: queueName := tenant + ".audit-log". A typed parameter gets its string() conversion.
  • A queue name that uses a parameter the address doesn't have stops the generator with an error.
  • Payload types come from go-jsonschema v0.27.0; v0.9.0 used v0.26.0. Generated code now:
    • decodes integers written as 2.0 or 1e2;
    • writes a required array or object left nil as [] or {}, not null;
    • checks the values that arrays and maps hold, such as each item's maxLength, and uniqueItems;
    • declares a constant for a property's const, such as OrderPlacedSchemaVersion.
  • Three of the test suite's specs change, only in those ways; the others generate byte-identical code to v0.9.0's.

Changelog

  • 6c81f7f Merge pull request #18 from plheide/fix/parameterised-queue-name
  • d3cd4f0 build: move to go-jsonschema v0.27.0
  • 54522f9 fix: fill in the address's parameters in a queue name

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 26 Oct 10:15
343aac7

Highlights

  • Payload types come from go-jsonschema v0.26.0; v0.8.0 used v0.25.0.
  • Generated code can reject messages that v0.8.0 accepted:
    • a oneOf of branches that only list required properties, such as "email or phone", now requires exactly one of them to be present;
    • an object's own if/then/else is enforced.
  • deprecated: true adds a // Deprecated: paragraph to the field's doc comment.
  • A wrapper for a union of primitive types, such as oneOf: [boolean, string], gets one constructor per type, such as NewOrderPlacedFlagBool.
  • The release binaries are built with Go 1.26.10. v0.8.0's were built with Go 1.26.2, which has standard-library vulnerabilities that govulncheck reports as reachable; Go 1.26.10 has none. go install builds with your own toolchain, so use Go 1.26.10 or later.
  • For every spec in the test suite, the generated code is byte-identical to v0.8.0's.

Changelog

  • 343aac7 Merge pull request #16 from plheide/build/go-jsonschema-v0.26.0
  • 54012b2 build: move to go-jsonschema v0.26.0
  • e50aa97 ci: build with Go 1.26.10

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 18 Oct 20:41
5963727

Highlights since v0.7.0

  • go install github.com/plheide/aapi-codegen/cmd/aapi-codegen@latest works. aapi-codegen depends on github.com/plheide/go-jsonschema v0.25.0 as a normal module.
  • Receive operations that share a message type generate code that compiles. Combinations that can't work stop the generator with an error.
  • Generated files keep their doc comments and start with // Code generated by aapi-codegen, DO NOT EDIT.
  • Payload types follow go-jsonschema v0.25, so regenerate and review the diff. For example:
    • type: [string, "null"] is *string, not a named pointer type;
    • a oneOf of a components $ref and null is a pointer to that type, not interface{};
    • a nullable enum is a typed enum, not a struct holding interface{};
    • format: int32 and format: int64 give int32 and int64, not int;
    • format: date and format: time use github.com/plheide/go-jsonschema/pkg/types;
    • a components array checks its own minItems and maxItems.

All changes: v0.7.0...v0.8.0. The rc.1 to rc.5 release notes describe each step.

Changelog

  • 5963727 Merge pull request #15 from plheide/build/go-jsonschema-v0.25.0
  • 9d1ce30 build: move to go-jsonschema v0.25.0

v0.8.0-rc.5

v0.8.0-rc.5 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Oct 18:52
d7d16b3

Highlights

  • Payload types come from go-jsonschema v0.25.0-rc.9; rc.4 used rc.8.
  • A oneOf of a components $ref and null is now a pointer to the referenced type, such as *Address, instead of interface{}. The anyOf form already was.
  • An anyOf that mixes an object with a primitive listed first is now interface{}. It was the primitive's type, which rejected object values.
  • A pattern that Go's regexp can't compile, such as a lookahead, is no longer checked. Its check used to reject every value.
  • For every spec in the test suite, the generated code is byte-identical to rc.4's.

Changelog

  • d7d16b3 Merge pull request #14 from plheide/build/go-jsonschema-rc.9
  • ee3d58c build: move to go-jsonschema v0.25.0-rc.9
  • 5e18504 ci: check out the full history in the release job

v0.8.0-rc.4

v0.8.0-rc.4 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Oct 05:38
990939c

Highlights

  • Payload types come from go-jsonschema v0.25.0-rc.8; rc.3 used rc.5.
  • format: int32 and format: int64 still give int32 and int64: go-jsonschema made that mapping opt-in, and aapi-codegen turns it on.
  • For every spec in the test suite, the generated code is byte-identical to rc.3's.
  • Other specs can change, so regenerate and review the diff:
    • an inline oneOf of an object and null is a pointer to a struct, not interface{};
    • a nullable enum is a typed enum, such as type Status string, not a struct holding interface{};
    • a components schema of type: array checks its own minItems and maxItems when decoding;
    • a default on an object property compiles; rc.3 wrote plain values into its pointer fields;
    • an anyOf no longer declares unused branch types such as OrderPlacedLines_0.
  • A oneOf of a components $ref and null is still interface{}.

Changelog

  • 4c3c349 ci(deps): bump goreleaser/goreleaser-action
  • 6a2a453 build: move to go-jsonschema v0.25.0-rc.8, keeping sized integer formats
  • f273560 Merge pull request #11 from plheide/dependabot/github_actions/github-actions-d5b5847ff0
  • c69631a Merge pull request #12 from plheide/build/go-jsonschema-rc.8
  • 45d7cd8 chore: point the install docs and download script at v0.8.0-rc.4
  • 990939c Merge pull request #13 from plheide/chore/release-v0.8.0-rc.4