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
generate the above, try to build, get syntax error:
error: invalid format string: expected `'}'`, found `'-'`
--> src/apis/default_api.rs:31:50
|
31 | let local_var_uri_str = format!("{}/test/{uwu-owo}", local_var_configuration.base_path, uwu-owo=crate::api...
| - ^ expected `'}'` in format string
| |
| because of this opening brace
|
= note: if you intended to print `{`, you can escape it using `{{`
Related issues/PRs
🤷♀️
Suggest a fix
Add dash replacement for format! key names
The text was updated successfully, but these errors were encountered:
# Enable globstar for recursive globbing in bashshopt -s globstar
# 3 words kebab-case to snake_case
sed -i -E 's/\{([a-z]+)-([a-z]+)-([a-z]+)\}/{\1_\2_\3}/g' my-generated-api/**/*.rs
sed -i -E 's/([a-z]+)-([a-z]+)-([a-z]+)\=/\1_\2_\3=/g' my-generated-api/**/*.rs
# 2 words kebab-case to snake_case
sed -i -E 's/\{([a-z]+)-([a-z]+)\}/{\1_\2}/g' my-generated-api/**/*.rs
sed -i -E 's/([a-z]+)-([a-z]+)\=/\1_\2=/g' my-generated-api/**/*.rs
Description
The Rust generator generates syntax errors when URI templates have parameter names with
-
dashes in them.openapi-generator version
0e05cf2
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
generate the above, try to build, get syntax error:
Related issues/PRs
🤷♀️
Suggest a fix
Add dash replacement for
format!
key namesThe text was updated successfully, but these errors were encountered: