[BUG][Rust Client] Duplicated crate::models in Params struct
Created by: alesharik
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
Generated rust client has duplicated crate::models
string in enum field types. But rust doesn't like it and fails with 'crate' in paths can only be used in start position
in compilation phase. Also tested with a
as query parameter, same results
openapi-generator version
5.0.0 5.0.1-SNAPSHOT 6.0.0-SNAPSHOT
OpenAPI declaration file content or url
---
openapi: 3.0.1
info:
title: v3
version: 3.0.0
servers:
- url: https://example.com
paths:
/v3/{a}:
get:
parameters:
- name: a
in: path
required: true
schema:
$ref: '#/components/schemas/ReleaseType'
responses:
"200":
description: search results matching criteria
components:
schemas:
ReleaseType:
default: ga
enum:
- ga
- ea
type: string
Generation Details
Generator: rust
Config:
{
"library": "reqwest",
"packageName": "api",
"packageVersion": "1.0.0",
"supportAsync": "true",
"useSingleRequestParameter": "true"
}
src/apis/default_api.rs
)
Expected output (/// struct for passing parameters to the method `v3_a_get`
#[derive(Clone, Debug)]
pub struct V3AGetParams {
pub a: crate::models::ReleaseType
}
src/apis/default_api.rs
)
Actual output (/// struct for passing parameters to the method `v3_a_get`
#[derive(Clone, Debug)]
pub struct V3AGetParams {
pub a: crate::models::crate::models::ReleaseType
}