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
  • Merge requests
  • !3494

[Rust Server] Allow more than 32 configured paths

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/Metaswitch/rust-32-paths into master Jul 29, 2019
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 26

Created by: richardwhiuk

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@bjgill @farcaller @frol

Description of the PR

Currently the Rust Server generator uses an array to store the paths available on an API.

If the API has more than 32 configured paths, then the produced API fails to compile with:

error[E0277]: `&[&str; 37]` is not an iterator
   --> src/server/mod.rs:113:60
    |
113 |         pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[
    |                                                            ^^^^^^^^^^^^^^^^^^^^ `&[&str; 37]` is not an iterator
    |
    = help: the trait `std::iter::Iterator` is not implemented for `&[&str; 37]`
    = note: required because of the requirements on the impl of `std::iter::IntoIterator` for `&[&str; 37]`
    = note: required by `server::paths::regex::RegexSet::new`

This is because Iterator is only implemented for arrays up to 32 in size.

This change avoids that limitation by moving to using a Vec, and adds a test API to the Rust Server tests which has 33 paths, to avoid hitting this limit again.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Metaswitch/rust-32-paths