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 client generator doubles type as &str&str for type:string; format:uuid parameter #10568

Closed
5 of 6 tasks
Dema opened this issue Oct 9, 2021 · 0 comments · Fixed by #10569
Closed
5 of 6 tasks

Comments

@Dema
Copy link
Contributor

Dema commented Oct 9, 2021

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

rust generator generates &str&str type for api call arguments when they are both type: string and format:uuid

openapi-generator version

latest master

OpenAPI declaration file content or url
swagger: "2.0"
info:
  version: API 1.0.0
  title: StrStrBug
basePath: /api
paths:
  /api/v1/item/{id}:
    get:
      tags:
        - my-controller
      summary: Get Item by Id.
      operationId: getByIdUsingGET
      produces:
        - "*/*"
      parameters:
        - name: id
          in: path
          description: id
          required: true
          type: string
          format: uuid
      responses:
        "200":
          description: OK
Generation Details
Steps to reproduce

java -jar openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ./swagger.yml -g rust --library hyper -o api

Expected output is

fn get_by_id_using_get(&self, id: &str) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {

Actual output is

fn get_by_id_using_get(&self, id: &str&str) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
Related issues/PRs
Suggest a fix

#10569

@Dema Dema added the Issue: Bug label Oct 9, 2021
wing328 pushed a commit that referenced this issue Oct 9, 2021
Do'not output &str for isString if it is also isUuid
wing328 pushed a commit that referenced this issue May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant