Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Rust] Generated client does not compile for kebab-cased path parameters #20295

Open
4 of 6 tasks
ranger-ross opened this issue Dec 11, 2024 · 0 comments
Open
4 of 6 tasks

Comments

@ranger-ross
Copy link
Contributor

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When building openapi schema that use kebab case in path parameters (ie. /v1/pet/pet-id) the Rust client does not compile

86 | ...   let local_var_uri_str = format!("{}/pet/{pet-id}", local_var_configuration.base_path, pet-id=pet_id);
   |                                               -   ^ expected `'}'` in format string
   |                                               |
   |                                               because of this opening brace
openapi-generator version
> openapi-generator-cli version
7.10.0
OpenAPI declaration file content or url

https://gist.github.com/ranger-ross/c2f6fd836c5bb3196c5d9c18eff712f4

Generation Details
generatorName: rust
library: reqwest-trait
additionalProperties:
  supportMiddleware: true
  preferUnsignedInt: true
  topLevelApiClient: true
  useBonBuilder: true
  mockall: true
Steps to reproduce
  1. generate the client using the schema and config provided above.
  2. cd to the output directory and run cargo build
Related issues/PRs

none

Suggest a fix

I believe that params should be normalized to underscore_snake_case to avoid compilation issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant