Skip to content

Releases: goadesign/goa

Goa v3.24.3

07 Feb 06:14
d77d595

Choose a tag to compare

Highlights

  • Codegen (views/OneOf): fix generated examples when a ResultType contains a OneOf (union) field by emitting the required union helpers in the views package. (#3884)
  • Codegen (mixed unary + SSE): support services that expose both unary and SSE streaming results cleanly. (#3883)
  • HTTP client codegen: fixes and improvements to the generated HTTP client. (#3879)

Full changelog

  • Compare: v3.24.2...v3.24.3

Goa v3.24.2

01 Feb 22:02
290966e

Choose a tag to compare

Highlights

  • Codegen correctness for union transforms: sum-type union object branches now use the generated per-type helper transforms, avoiding branch-local inline conversions that could disagree on details (notably nested map key casts). (#3880)
  • Qualified type refs are now stable and real: transport codegen no longer “suffixes” the Type portion of pkg.Type refs (preventing invalid refs like pkg.Foo2), while still reusing the scoped name when the service scope had to suffix due to collisions. (#3878)
  • Union validation pointer semantics fixed: sum-type union branch validation now derives pointer/value semantics from the branch value (esp. object branches) rather than the enclosing field context. (#3876)
  • Meta is now extensible for plugins: introduced expr.MetaAdder / expr.MetaDeleter, shrinking dsl.Meta/RemoveMeta and enabling third-party expressions to participate without Goa knowing their concrete types; also fixes an OpenAPI regression where host metadata could attach to host variables. (#3874)

What changed

Codegen / transforms

  • Union object branches: GoTransform now prefers helper transforms for object branches in sum-type unions, improving consistency and preventing subtle type mismatches. (#3880)
  • Name scoping across packages: qualified refs now respect scoping rules without inventing external identifiers; transport packages that reference suffixed service types will correctly reference the suffixed name. (#3878)

Validation + gRPC

  • Sum-type union validation now matches the actual generated union field shapes (value vs pointer). (#3876)
  • gRPC union member shape validation moved out of AttributeExpr.Validate into gRPC endpoint validation with recursion guards (more correct layering, fewer surprise validations). (#3876)

DSL / expr

  • Added expr.MetaAdder / expr.MetaDeleter and wired core expressions + attributes into them; dsl.Meta/RemoveMeta now dispatch via these interfaces (and still supports CompositeExpr correctly). (#3874)

Upgrade notes

  • Regenerate: this release changes generated code shape in union transforms and may affect transport packages with scoped type collisions. After upgrading, run your normal regeneration flow (e.g. goa gen / go generate), then review the diff.
go get goa.design/goa/[email protected]

Full changelog

  • #3874 dsl/meta: make Meta extensible via expr.MetaAdder
  • #3876 codegen: fix union-sum validation pointer semantics
  • #3878 codegen: reuse scoped names for qualified refs
  • #3880 codegen: use helper transforms for union object branches

Compare: v3.24.1...v3.24.2

v3.24.1

18 Jan 16:48
fd60b2d

Choose a tag to compare

Goa v3.24.1

Highlights

  • Fix: unions + custom struct:pkg:path now generate valid code

    v3.24.0 introduced generated JSON marshalers for union sum types. When a union (or a type containing a union) was generated into a separate file via Meta("struct:pkg:path", ...), the generated file could miss the required encoding/json import, causing compile failures.

    v3.24.1 fixes this by ensuring service codegen struct:pkg:path “User types” files include the JSON import.

Changelog

  • Fixed: missing encoding/json import for union sum types generated into struct:pkg:path files.
  • Added: regression test to prevent this from happening again.

Previously in v3.24.0 (included here so you don’t miss it)

Highlights (read this first)

  • Breaking: OneOf unions are now generated as first-class sum types across Goa codegen (service types + HTTP client/server types), with a discriminator (Kind) and typed constructors/accessors/setters. This is a major ergonomics + correctness upgrade, but it will break existing code that used the old interface-based union representation.

    See PR #3866: “Redesign OneOf unions as first-class sum types”.

Breaking Changes

  • Breaking: Union/OneOf generated Go API changed (regen required). (PR #3866)

    • Before: unions were represented as an interface with marker methods (e.g. interface{ valuesVal() }) and consumed via switch x := u.(type) { ... }.
    • Now: unions are generated as a concrete sum-type struct with:
      • Kind() discriminator
      • New<Union><Branch>(...) constructors
      • As<Branch>() (v, ok) accessors
      • Set<Branch>(...) setters
      • Validate() + JSON {type,value} MarshalJSON/UnmarshalJSON
    • Migration checklist:
      • Regenerate (goa gen ...)
      • Replace type-switches with switch u.Kind() / u.AsXxx()
      • Replace direct assignment of branch types with New... / Set...
  • Breaking: gRPC Any now maps to google.protobuf.Value (structpb.Value) instead of google.protobuf.Any. (PR #3868)

    This changes the generated proto surface; regenerate and update non-Go clients accordingly.

Notable Additions

  • Union JSON key customization: Meta("oneof:type:field", "...") and Meta("oneof:value:field", "...") let you rename the canonical {type,value} keys for union JSON encoding (e.g. {kind,data}), with DSL-level validation.

    Included as part of the union redesign work; see PR #3866.

  • struct:tag:json:name meta: set a JSON field name without having to override the full json tag; Goa still computes omitempty properly. (PR #3867)

Dependency Updates

v3.23.4

14 Dec 23:35
c5c2f7d

Choose a tag to compare

What's Changed

Bug Fixes

  • eval: Fix error location for module cache paths (#3861)

    When Goa is consumed from the Go module cache, file paths contain @version segments (e.g., goa/[email protected]/dsl/...). The error location heuristic was failing to recognize these as DSL frames, causing errors to point at internal DSL files rather than the user's design.

    Error messages now correctly show:

    [design.go:5] invalid use of View in type "SomeType"
    

    instead of:

    [.../dsl/result_type.go:215] invalid use of View in attribute
    
  • http: Preserve Content-Type parameters set in DSL (#3860)

    Fixes an issue where Content-Type parameters specified in the DSL were being dropped.

  • codegen: Skip example generation for agent-only designs (#3858)

    Fixes crashes when running goa example on designs that only define agents (no HTTP/gRPC transports).

New Features

  • grpc/codegen: Allow overriding proto json_name (#3857)

    You can now customize the JSON field name in generated proto files.

Other Changes

  • ci: Upgrade Go versions to 1.24 and 1.25 (#3859)
  • deps: Update module dependencies (#3862)

Contributors

A huge thank you to our contributors for this release:

Full Changelog: v3.23.3...v3.23.4

v3.23.2

26 Nov 21:41
ae9e54b

Choose a tag to compare

What's Changed

  • grpc: complete validation helper naming fix by @raphael in #3854

Full Changelog: v3.23.1...v3.23.2

v3.23.1

26 Nov 08:02
debd643

Choose a tag to compare

What's Changed

  • grpc: fix validation helper naming to match call sites by @raphael in #3853

Full Changelog: v3.23.0...v3.23.1

v3.23.0

26 Nov 01:35
393e8a4

Choose a tag to compare

Goa v3.23.0

We are thrilled to announce Goa v3.23.0! This release brings massive performance improvements to the code generation process, speeding it up by over 80%. It also includes important updates to the DSL, improved validation logic, and support for the latest JSON Schema draft in OpenAPI.

Performance

  • Massive Code Generation Speedup: The code generator has been optimized to be over 80% faster, making your development loop tighter than ever. (#3832, #3833)
  • Optimized File Writes: Reduced I/O overhead during generation. (#3852)

New Features

  • Absolute Mount Paths: The Files DSL now supports absolute paths using the // prefix, allowing you to mount static files at the server root regardless of API or service prefixes. (#3837)
  • Method DSL Update: The Method function now returns MethodExpr, enabling more flexible DSL composition. (#3850)
  • OpenAPI Update: The generated OpenAPI definitions now use JSON Schema Draft 2020-12. (#3838)

Bug Fixes

  • Validation Improvements:
    • Fixed recursion guard propagation and alias type handling in validation code. (#3836)
    • Added support for non-nullable elements in ArrayOfRequired validation. (#3834)
    • Preserved underscores in validation function names to avoid naming conflicts. (#3842)
    • Fixed validation helper naming for protobuf messages. (#3844)
    • Added guards for nil elements in array transforms to prevent panics. (#3830)
  • HTTP/JSON-RPC: Fixed handler argument ordering for HTTP servers hosting JSON-RPC services. (#3831)

Dependency Updates

  • Updated module dependencies to their latest versions. (#3851)
  • Bumped actions/checkout to v6. (#3845)
  • Bumped github/codeql-action to v4. (#3818)
  • Bumped actions/upload-artifact to v5. (#3829)

Contributors

A huge thank you to our contributors for this release:

v3.22.6

19 Oct 04:19
a7ed238

Choose a tag to compare

New Features

  • http/codegen(sse): format SSE data using response body types with primitive-friendly encoding (#3821)

Bug Fixes

  • expr/interceptor: fix attribute validation to consider inherited attributes from Extend (#3822)
  • http/codegen: add GetBody to requests with JSON encoder to fix HTTP/2 retry errors (#3737)
  • http/openapi/v3: normalize file server wildcards and add parameter schema for wildcard paths (#3816)
  • codegen/cli: escape CLI examples to avoid raw backticks and fmt formatting artifacts (#3815)

Thank you!

Thanks to @duckbrain and @raphael for the contributions!

v3.22.5

04 Oct 17:09
fe2f0fa

Choose a tag to compare

This release includes a few new features and bug fixes.

New Features

  • grpc: add support for Any type mapping to google.protobuf.Any (#3812)
  • grpc: enhance error handling with detailed history in ErrorResponse (#3810)

Bug Fixes

  • http/codegen: fix SSE client unused locals and struct decode (#3813)
  • codegen(service): add SendWithContext and RecvWithContext methods to streaming interfaces (#3811)

v3.22.3

21 Sep 06:24
f1ba1d6

Choose a tag to compare

What's Changed

  • codegen(service,jsonrpc): dedupe SSE event markers and JSON-RPC SSE switch cases for shared result types; add tests by @raphael in #3805
  • gRPC: Avoid synthetic wrappers for user-type OneOfs; add regression test by @raphael in #3808
  • chore: redirect CLAUDE.md to AGENTS.md by @raphael in #3809

Full Changelog: v3.22.2...v3.22.3