You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(codegen): update code generation to use non-global root (#3721)
* refactor(codegen): update code generation to use non-global root expressions
This commit modifies the code generation logic to consistently utilize a non-global root expressions across various files. Changes include updating function signatures and internal calls to pass the root expression, ensuring that the generated code correctly references the API structure. This refactor removes the need for code generation algorithms to refer to the global root expression variable.
* refactor(codegen): improve ServicesData naming and structure consistency
- Embed service.ServicesData in transport packages to eliminate confusing field names
- Rename transport service maps to GRPCServices/HTTPServices for clarity
- Add constructor functions to reduce boilerplate initialization
- Update variable names from serviceData to services for semantic accuracy
- Establish consistent patterns across service, HTTP, and gRPC codegen packages
This eliminates the confusing naming where ServicesData contained a ServiceData field,
and creates clear separation between service layer and transport layer data structures.
* refactor(codegen): streamline service file generation and enhance template handling
- Consolidate file appending in Service function for improved readability.
- Simplify section template creation in EndpointFile and ViewsFile functions.
- Introduce IsAliased and ServiceTypeRef fields in ServiceData for better type resolution.
- Update request initialization template to utilize new fields for aliased types.
These changes enhance the clarity and efficiency of the code generation process, ensuring better maintainability and consistency across service files.
0 commit comments