Skip to content

[Rust Server] Allow more than 32 configured paths #3494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mod paths {
extern crate regex;

lazy_static! {
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![
{{#pathSet}}
r"^{{{basePathWithoutHost}}}{{{pathRegEx}}}"{{^-last}},{{/-last}}
{{/pathSet}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Test large number of configured operations

openapi: 3.0.1
info:
title: Regression test for large number of operations
version: 0.0.1
paths:
/op1:
get:
responses:
'200':
description: 'OK'
/op2:
get:
responses:
'200':
description: 'OK'
/op3:
get:
responses:
'200':
description: 'OK'
/op4:
get:
responses:
'200':
description: 'OK'
/op5:
get:
responses:
'200':
description: 'OK'
/op6:
get:
responses:
'200':
description: 'OK'
/op7:
get:
responses:
'200':
description: 'OK'
/op8:
get:
responses:
'200':
description: 'OK'
/op9:
get:
responses:
'200':
description: 'OK'
/op10:
get:
responses:
'200':
description: 'OK'
/op11:
get:
responses:
'200':
description: 'OK'
/op12:
get:
responses:
'200':
description: 'OK'
/op13:
get:
responses:
'200':
description: 'OK'
/op14:
get:
responses:
'200':
description: 'OK'
/op15:
get:
responses:
'200':
description: 'OK'
/op16:
get:
responses:
'200':
description: 'OK'
/op17:
get:
responses:
'200':
description: 'OK'
/op18:
get:
responses:
'200':
description: 'OK'
/op19:
get:
responses:
'200':
description: 'OK'
/op20:
get:
responses:
'200':
description: 'OK'
/op21:
get:
responses:
'200':
description: 'OK'
/op22:
get:
responses:
'200':
description: 'OK'
/op23:
get:
responses:
'200':
description: 'OK'
/op24:
get:
responses:
'200':
description: 'OK'
/op25:
get:
responses:
'200':
description: 'OK'
/op26:
get:
responses:
'200':
description: 'OK'
/op27:
get:
responses:
'200':
description: 'OK'
/op28:
get:
responses:
'200':
description: 'OK'
/op29:
get:
responses:
'200':
description: 'OK'
/op30:
get:
responses:
'200':
description: 'OK'
/op31:
get:
responses:
'200':
description: 'OK'
/op32:
get:
responses:
'200':
description: 'OK'
/op33:
get:
responses:
'200':
description: 'OK'
/op34:
get:
responses:
'200':
description: 'OK'
/op35:
get:
responses:
'200':
description: 'OK'
/op36:
get:
responses:
'200':
description: 'OK'
/op37:
get:
responses:
'200':
description: 'OK'
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ mod paths {
extern crate regex;

lazy_static! {
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![
r"^/required_octet_stream$",
r"^/xml$",
r"^/xml_extra$",
Expand Down
18 changes: 18 additions & 0 deletions samples/server/petstore/rust-server/output/ops-v3/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build]
rustflags = [
"-W", "missing_docs", # detects missing documentation for public members

"-W", "trivial_casts", # detects trivial casts which could be removed

"-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed

"-W", "unsafe_code", # usage of `unsafe` code

"-W", "unused_qualifications", # detects unnecessarily qualified names

"-W", "unused_extern_crates", # extern crates that are never used

"-W", "unused_import_braces", # unnecessary braces around an imported item

"-D", "warnings", # all warnings should be denied
]
2 changes: 2 additions & 0 deletions samples/server/petstore/rust-server/output/ops-v3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
Cargo.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.1.0-SNAPSHOT
48 changes: 48 additions & 0 deletions samples/server/petstore/rust-server/output/ops-v3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[package]
name = "ops-v3"
version = "0.0.1"
authors = []
description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)"
license = "Unlicense"

[features]
default = ["client", "server"]
client = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"]
server = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"]

[dependencies]
# Required by example server.
#
chrono = { version = "0.4", features = ["serde"] }
futures = "0.1"
hyper = {version = "0.11", optional = true}
hyper-tls = {version = "0.1.2", optional = true}
swagger = "2"

# Not required by example server.
#
lazy_static = "0.2"
log = "0.3.0"
mime = "0.3.3"
multipart = {version = "0.13.3", optional = true}
native-tls = {version = "0.1.4", optional = true}
openssl = {version = "0.9.14", optional = true}
percent-encoding = {version = "1.0.0", optional = true}
regex = {version = "0.2", optional = true}
serde = "1.0"
serde_derive = "1.0"
serde_ignored = {version = "0.0.4", optional = true}
serde_json = {version = "1.0", optional = true}
serde_urlencoded = {version = "0.5.1", optional = true}
tokio-core = {version = "0.1.6", optional = true}
tokio-proto = {version = "0.1.1", optional = true}
tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]}
url = {version = "1.5", optional = true}
uuid = {version = "0.5", optional = true, features = ["serde", "v4"]}
# ToDo: this should be updated to point at the official crate once
# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream


[dev-dependencies]
clap = "2.25"
error-chain = "0.12"
Loading