Problem
The Python codegen (via quicktype) produces mangled/abbreviated type names for types with long names in the runtime API schema. For example:
PermissionDecisionApprovedForIonApproval instead of PermissionDecisionApprovedForSessionApproval
PermissionDecisionApprovedForEntApproval instead of PermissionDecisionApprovedForPersistentApproval
This only affects Python — Go and C# codegen produce the correct full names from the same schema.
Root Cause
quicktype appears to truncate or abbreviate type names that exceed a certain length when generating Python code. The exact mechanism is unclear — it may be a Python-specific name shortening heuristic in quicktype, or a configurable option we're not setting.
Impact
The generated Python types don't match the runtime API schema names. This means we're shipping public APIs that have bad names we'll want to change later, which will be a breaking change. So we should resolve this soon, certainly before GA.
Possible Fixes
- Investigate quicktype Python options to disable name mangling/abbreviation
- Add a post-processing step to the Python codegen to fix known mangled names
- Consider an alternative Python code generator if quicktype can't be configured
Overall I've really had enough of quicktype and its unfortunate behaviors. Since we've built a pretty decent standalone codegenerator for C#, I wonder if we can factor out some sort of language-independent core from that (e.g., building an intermediate representation of all the types and methods we want to emit), and then add per-language renderers on top of that.
Problem
The Python codegen (via quicktype) produces mangled/abbreviated type names for types with long names in the runtime API schema. For example:
PermissionDecisionApprovedForIonApprovalinstead ofPermissionDecisionApprovedForSessionApprovalPermissionDecisionApprovedForEntApprovalinstead ofPermissionDecisionApprovedForPersistentApprovalThis only affects Python — Go and C# codegen produce the correct full names from the same schema.
Root Cause
quicktype appears to truncate or abbreviate type names that exceed a certain length when generating Python code. The exact mechanism is unclear — it may be a Python-specific name shortening heuristic in quicktype, or a configurable option we're not setting.
Impact
The generated Python types don't match the runtime API schema names. This means we're shipping public APIs that have bad names we'll want to change later, which will be a breaking change. So we should resolve this soon, certainly before GA.
Possible Fixes
Overall I've really had enough of quicktype and its unfortunate behaviors. Since we've built a pretty decent standalone codegenerator for C#, I wonder if we can factor out some sort of language-independent core from that (e.g., building an intermediate representation of all the types and methods we want to emit), and then add per-language renderers on top of that.