Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5906
Closed
Open
Issue created Apr 13, 2020 by Administrator@rootContributor0 of 4 checklist items completed0/4 checklist items

[BUG] [Rust Server] Generated Rust code with yaml path parameter compile error.

Created by: paladinzh

Bug Report Checklist

  • [ Y ] Have you provided a full/minimal spec to reproduce the issue?
  • [ Y ] Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Using the following yaml file with path parameter and multi tag, generated Rust code compile error.

//modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml @@ -359,6 +359,24 @@ paths: '200': description: Success

  • /repos/{repoId}:
  • parameters:
  •  - in: path
  •    name: repoId
  •    schema:
  •      type: string
  •    required: true
  • get:
  •  tags: [Repo, Info]
  •  operationId: GetRepoInfo
  •  responses:
  •    "200":
  •      description: OK
  •      content:
  •        application/json:
  •          schema:
  •            $ref: "#/components/schemas/StringObject"
  1. help: use dyn: dyn Future<Item=CallbackWithHeaderPostResponse, Error=ApiError> + Send error: trait objects without an explicit dyn are deprecated --> output/openapi-v3/examples/server/server.rs:137:29 | 137 | context: &C) -> Box<Future<Item=CallbackWithHeaderPostResponse, Error=ApiError> + Send> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn Future<Item=CallbackWithHeaderPostResponse, Error=ApiError> + Send | = note: -D bare-trait-objects implied by -D warnings

error: trait objects without an explicit dyn are deprecated --> output/openapi-v3/examples/server/server.rs:147:29 | 147 | context: &C) -> Box<Future<Item=ComplexQueryParamGetResponse, Error=ApiError> + Send> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn Future<Item=ComplexQueryParamGetResponse, Error=ApiError> + Send

  1. Generate Rust code "repoId" isue, Not "Repoid", and compile error. regex::Regex::new(r"^/v2/repos/(?P[^/?#]*)$")

  2. multi tag will generate multi method.

openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking