Skip to content

Commit aad02ed

Browse files
committed
Markups and testing. Run on local fork
1 parent 0b11548 commit aad02ed

25 files changed

Lines changed: 154 additions & 12 deletions

File tree

.github/workflows/openapi-generator.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: OpenAPI Generator
22

33
on:
44
push:
5-
branches:
6-
- master
7-
- '[5-9]+.[0-9]+.x'
5+
# branches:
6+
# - master
7+
# - '[5-9]+.[0-9]+.x'
88
pull_request:
99
branches:
1010
- master

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public RustServerCodegen() {
222222
*/
223223
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
224224
supportingFiles.add(new SupportingFile("Cargo.mustache", "", "Cargo.toml"));
225-
supportingFiles.add(new SupportingFile("cargo-config", ".cargo", "config"));
225+
supportingFiles.add(new SupportingFile("cargo-config", ".cargo", "config.toml"));
226226
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
227227
supportingFiles.add(new SupportingFile("lib.mustache", "src", "lib.rs"));
228228
supportingFiles.add(new SupportingFile("context.mustache", "src", "context.rs"));

modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ regex = { version = "1.11", optional = true }
138138

139139
# CLI-specific
140140
anyhow = { version = "1", optional = true }
141+
clap = { version = "4.5", optional = true }
141142
clap-verbosity-flag = { version = "3.0", optional = true }
142143
simple_logger = { version = "5.0", features = ["stderr"], optional = true }
143144
tokio = { version = "1.45", features = ["rt-multi-thread", "macros"], optional = true }

samples/server/petstore/rust-server/.cargo/config renamed to samples/server/petstore/rust-server/.cargo/config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ rustflags = [
66

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

9-
"-W", "unsafe_code", # usage of `unsafe` code
9+
# unsafe is used in `TokioIo` bridging code copied from `hyper`.
10+
# "-W", "unsafe_code", # usage of `unsafe` code
1011

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[build]
2+
rustflags = [
3+
"-W", "missing_docs", # detects missing documentation for public members
4+
5+
"-W", "trivial_casts", # detects trivial casts which could be removed
6+
7+
"-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed
8+
9+
# unsafe is used in `TokioIo` bridging code copied from `hyper`.
10+
# "-W", "unsafe_code", # usage of `unsafe` code
11+
12+
"-W", "unused_qualifications", # detects unnecessarily qualified names
13+
14+
"-W", "unused_extern_crates", # extern crates that are never used
15+
16+
"-W", "unused_import_braces", # unnecessary braces around an imported item
17+
18+
"-D", "warnings", # all warnings should be denied
19+
]

samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.cargo/config
1+
.cargo/config.toml
22
.gitignore
33
Cargo.toml
44
README.md

samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ regex = { version = "1.11", optional = true }
7171

7272
# CLI-specific
7373
anyhow = { version = "1", optional = true }
74+
clap = { version = "4.5", optional = true }
7475
clap-verbosity-flag = { version = "3.0", optional = true }
7576
simple_logger = { version = "5.0", features = ["stderr"], optional = true }
7677
tokio = { version = "1.45", features = ["rt-multi-thread", "macros"], optional = true }
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[build]
2+
rustflags = [
3+
"-W", "missing_docs", # detects missing documentation for public members
4+
5+
"-W", "trivial_casts", # detects trivial casts which could be removed
6+
7+
"-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed
8+
9+
# unsafe is used in `TokioIo` bridging code copied from `hyper`.
10+
# "-W", "unsafe_code", # usage of `unsafe` code
11+
12+
"-W", "unused_qualifications", # detects unnecessarily qualified names
13+
14+
"-W", "unused_extern_crates", # extern crates that are never used
15+
16+
"-W", "unused_import_braces", # unnecessary braces around an imported item
17+
18+
"-D", "warnings", # all warnings should be denied
19+
]

samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.cargo/config
1+
.cargo/config.toml
22
.gitignore
33
Cargo.toml
44
README.md

samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ regex = { version = "1.11", optional = true }
6161

6262
# CLI-specific
6363
anyhow = { version = "1", optional = true }
64+
clap = { version = "4.5", optional = true }
6465
clap-verbosity-flag = { version = "3.0", optional = true }
6566
simple_logger = { version = "5.0", features = ["stderr"], optional = true }
6667
tokio = { version = "1.45", features = ["rt-multi-thread", "macros"], optional = true }

0 commit comments

Comments
 (0)