Releases: goadesign/goa
Goa v3.24.3
Highlights
- Codegen (views/OneOf): fix generated examples when a
ResultTypecontains aOneOf(union) field by emitting the required union helpers in theviewspackage. (#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
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
Typeportion ofpkg.Typerefs (preventing invalid refs likepkg.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)
Metais now extensible for plugins: introducedexpr.MetaAdder/expr.MetaDeleter, shrinkingdsl.Meta/RemoveMetaand 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:
GoTransformnow 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.Validateinto gRPC endpoint validation with recursion guards (more correct layering, fewer surprise validations). (#3876)
DSL / expr
- Added
expr.MetaAdder/expr.MetaDeleterand wired core expressions + attributes into them;dsl.Meta/RemoveMetanow dispatch via these interfaces (and still supportsCompositeExprcorrectly). (#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
Goa v3.24.1
Highlights
-
Fix: unions + custom
struct:pkg:pathnow generate valid codev3.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 requiredencoding/jsonimport, 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/jsonimport for union sum types generated intostruct:pkg:pathfiles. - 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:
OneOfunions 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/
OneOfgenerated Go API changed (regen required). (PR #3866)- Before: unions were represented as an interface with marker methods (e.g.
interface{ valuesVal() }) and consumed viaswitch x := u.(type) { ... }. - Now: unions are generated as a concrete sum-type struct with:
Kind()discriminatorNew<Union><Branch>(...)constructorsAs<Branch>() (v, ok)accessorsSet<Branch>(...)settersValidate()+ 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...
- Regenerate (
- Before: unions were represented as an interface with marker methods (e.g.
-
Breaking: gRPC
Anynow maps togoogle.protobuf.Value(structpb.Value) instead ofgoogle.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", "...")andMeta("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:namemeta: set a JSON field name without having to override the fulljsontag; Goa still computesomitemptyproperly. (PR #3867)
Dependency Updates
v3.23.4
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
@versionsegments (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 exampleon 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
Contributors
A huge thank you to our contributors for this release:
Full Changelog: v3.23.3...v3.23.4
v3.23.2
v3.23.1
v3.23.0
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
FilesDSL 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
Methodfunction now returnsMethodExpr, 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
ArrayOfRequiredvalidation. (#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:
- Isaac Seymour (@isaacseymour)
- Lawrence Jones (@lawrencejones)
- Raphael Simon (@raphael)
v3.22.6
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
v3.22.3
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