Bug Report Checklist
Description
Function parameters are properly escaped with r# but with the new reqwest-trait client we introduced lifetime parameters that reused to the parameter name.
# is not valid in lifetime names.
Error
115 | async fn find_pets_by_status<'r#type>(&self, r#type: Option<&'r#type str>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
| ^ expected one of `,`, `:`, or `>`
openapi-generator version
build from source Git Hash cc40f40
OpenAPI declaration file content or url
# ...
/pet/findByStatus:
get:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
parameters:
- name: type # <------- This is a Rust keyword
in: query
description: Status values that need to be considered for filter
required: false
explode: true
schema:
type: string
default: available
enum:
- available
- pending
- sold
# ...
Generation Details
generatorName: rust
library: reqwest-trait
additionalProperties:
supportMiddleware: true
preferUnsignedInt: true
topLevelApiClient: true
useBonBuilder: true
mockall: true
Steps to reproduce
- Create an openapi spec with query param with the name of any Rust keyword
- Generate the client with the config above
- Run
cargo build
Related issues/PRs
Suggest a fix
This can be fixed by simply replacing the r# with a r_ as that is a valid lifetime name.
Bug Report Checklist
Description
Function parameters are properly escaped with
r#but with the new reqwest-trait client we introduced lifetime parameters that reused to the parameter name.#is not valid in lifetime names.Error
openapi-generator version
build from source Git Hash cc40f40
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
cargo buildRelated issues/PRs
Suggest a fix
This can be fixed by simply replacing the
r#with ar_as that is a valid lifetime name.