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
Overly Broad Type Generated When Using "const" #10
The good news is that this works, in that I can call my API this way, but I'd expect it to be more tightly constrained. Rust doesn't have literal values the way Python or TS does and I'm not sure how other Rust libraries handle this... I imagine the better thing would be to emit an enum with only one option, so I'd end up constructing it something like:
let myModifier = ConstModifier{some_constant:Some(ConstModifierSomeConstantType::TheOnlyValidValue),};
It certainly makes sense in our case (where the constant is a placeholder for expanding into an enum).
Awesome! I like it. It looks like this solved the issue for schemas, but not for when the "const" variable is used directly as an argument for an endpoint/operation. For instance, in "paths":
Activity
lightsofapollo commentedon May 7, 2026
hrrm I'll take a look and see what I can come up with
Merge pull request #12 from gpu-cli/fix/issue-10-const-only-property
atom-mfeldkamp commentedon May 8, 2026
Awesome! I like it. It looks like this solved the issue for schemas, but not for when the
"const"variable is used directly as an argument for an endpoint/operation. For instance, in"paths":Generates this function signature:
lightsofapollo commentedon May 8, 2026
Oh interesting- TBH I didn't realize that was an option lol ... Looking now
lightsofapollo commentedon May 8, 2026
#13 fixes this
atom-mfeldkamp commentedon May 8, 2026
Nice! Thank you!
And I did say the API we're targeting is a little pathological 😅, haha...