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
  • #317
Closed
Open
Issue created Jun 14, 2018 by Administrator@rootContributor

[rust-server] doesn't support arrays of non-strings in query parameters

Created by: bjgill

Description

See https://github.com/swagger-api/swagger-codegen/issues/8169#issuecomment-388858171.

It looks as if we're currently assuming that arrays in query parameters must be arrays of strings. I suspect this probably just requires some tinkering with the mustache templates.

...
error[E0277]: `std::vec::Vec<i32>` doesn't implement `std::fmt::Display`
     --> src/client/mod.rs:37212:134
      |
37212 |         let query_connections = param_connections.map_or_else(String::new, |query| format!("connections={connections}&", connections=query.join(",")));
      |                                                                                                                                      ^^^^^^^^^^^^^^^ `std::vec::Vec<i32>` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
      |
      = help: the trait `std::fmt::Display` is not implemented for `std::vec::Vec<i32>`
      = note: required by `std::fmt::Display::fmt`

error[E0277]: the trait bound `std::vec::Vec<i32>: std::str::FromStr` is not satisfied
     --> src/server/mod.rs:37122:71
      |
37122 |                     .filter_map(|param_connections| param_connections.parse::<Vec<i32>>().ok())
      |                                                                       ^^^^^ the trait `std::str::FromStr` is not implemented for `std::vec::Ve
...
openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Assignee
Assign to
Time tracking