Skip to content

[BUG] Rust client generator doubles type as &str&str for type:string; format:uuid parameter #10568

@Dema

Description

@Dema

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions