Goa v3.21.5 Release Notes
Major Architectural Improvements
Eliminated Global Dependencies in Code Generation (#3721)
by @raphael
The code generation architecture has been significantly refactored to remove global state dependencies, improving maintainability and testability:
- Non-global root expressions: Code generation now passes root expressions as parameters instead of relying on global variables
- Restructured ServicesData: Eliminated confusing nested ServicesData structures, creating clear separation between service and transport layer data
- Streamlined file generation: Improved naming conventions and modularity throughout the codebase
- Maintains full backward compatibility - no changes required for existing applications
Bug Fixes
gRPC Streaming Error Handling (#3731)
by @raphael
Fixed a critical issue where gRPC streaming Recv()
methods were not properly decoding custom error types:
- Streaming methods now decode errors consistently with unary methods
- Clients can now properly handle custom service errors defined in the DSL
- Applies to all streaming patterns: server, client, and bidirectional
- Fixes issue #3320
Example Generation for UserTypes (#3730)
by @raphael
Corrected example generation for UserTypes to respect validation rules and custom examples:
- UserTypes with format validation (e.g.,
FormatURI
) now generate format-appropriate examples - Custom examples defined on UserTypes are now properly used
- Fixes issue #3716
HTTP Error Handler Code Generation (#3741)
Fixed multiple issues in HTTP code generation:
- Properly generate error handler function parameter with validation attributes
- Fixed missing generation of
errhandler
function in HTTP handlers (since it's optional) - Improved overall error handling code generation
Type Handling Improvements
- Primitive alias types (#3742) by @raphael: Fixed casting to use underlying types instead of service types (e.g., string instead of UUID) in request building logic
- Import generation (#3744) by @raphael: Added missing import statement generation in certain edge cases
- Example compilation (#3743) by @raphael: Fixed various issues discovered while building the framework examples
OpenAPI Specification Enhancements
Improved MapOf Schema Generation (#3732)
by @fzyukio
Enhanced OpenAPI 3.0 schema generation for MapOf
types:
- All map values now have fully-typed schemas regardless of key type
- Replaced ambiguous
additionalProperties: true
with proper type references - Improves compatibility with OpenAPI code generators like oapi-codegen
- Maps with non-string keys now generate correct schemas (since OpenAPI only supports string keys)
Code Quality Improvements
Modern Error Handling (#3736)
by @tchssk
Updated generated code to use Go's modern error handling patterns:
- Templates now use
errors.Is()
for error comparisons - Improves compatibility with wrapped errors
- Related to issue #3541
Defensive Programming (#3727)
Added safety checks for nil interceptors:
- Endpoints are now only wrapped with interceptors when they are actually provided
- Prevents potential nil pointer dereferences
New Contributors
Full Changelog: v3.21.1...v3.21.5