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
{{ message }}
Repository navigation
Missing package name on type from common API spec when referencing a path operation from another spec in generated code #1378
We're hitting a bug where generated code doesn't compile when using API specs referencing each other. This may or may not be related to #695, so I'm opening a separate issue just to be sure.
changed the title [-]Missing package name on type from common API spec when referencing from another spec in generated code[/-][+]Missing package name on type from common API spec when referencing a path operation from another spec in generated code[/+]on Dec 8, 2023
Activity
markuswustenberg commentedon Dec 8, 2023
For anyone in the same situation, I made a small script to parse the generated code, fix the type imports, and write the code back out:
replacements.jsonwould look something like this:{ "Replacements": [ {"Search": "YourType", "Replace": "externalRef0.YourType"} ] }[-]Missing package name on type from common API spec when referencing from another spec in generated code[/-][+]Missing package name on type from common API spec when referencing a path operation from another spec in generated code[/+]markuswustenberg commentedon Dec 12, 2023
I also saw this problem inside functions with statements such as
var t YourTypewhen using path parameters.Fix: Ensure external refs are propagated to generated code
Fix: Ensure external refs are propagated to generated code
Fix: Ensure external refs are propagated to generated code
Fix: Ensure external refs are propagated to generated code