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
If a path parameter has a dot in it (e.g. item.id) then swagger-typescript-api will rewrite this to camelCase for the parameter name but not in the path string interpolation, which leads in nonfunctional code.
Repro
Here's a minimal (or at least small) input to reproduce this:
Note that the path (/foobar/{truck.id}/item) references a variable ("truck.id") that does not exist, since the function parameter was rewritten to be truckId.
p.s. The obvious solution here is "don't use parameters with dots in them - that's weird!". Unfortunately the swagger we are using is itself generated by grpc-gateway which supports nested fields via dot notation (example) so there's no easy way to avoid this...
The text was updated successfully, but these errors were encountered:
Summary
If a path parameter has a dot in it (e.g.
item.id
) thenswagger-typescript-api
will rewrite this to camelCase for the parameter name but not in the path string interpolation, which leads in nonfunctional code.Repro
Here's a minimal (or at least small) input to reproduce this:
Expected output:
Actual output:
Note that the path (
/foobar/{truck.id}/item
) references a variable ("truck.id") that does not exist, since the function parameter was rewritten to betruckId
.p.s. The obvious solution here is "don't use parameters with dots in them - that's weird!". Unfortunately the swagger we are using is itself generated by grpc-gateway which supports nested fields via dot notation (example) so there's no easy way to avoid this...
The text was updated successfully, but these errors were encountered: