Skip to content
Draft
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
14 changes: 10 additions & 4 deletions .github/workflows/samples-rust-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,22 @@ jobs:
run: |
set -e

# Iterate through each example and test various features
for package in $(find . -maxdepth 1 -mindepth 1 -type d)
# Iterate through each package and test various features
for package in $(find output -maxdepth 1 -mindepth 1 -type d)
do
pushd $package
# Not all versions have a server example
if test -f examples/server/main.rs; then
cargo build --example server --features="server"
cargo build --example ${package##*/}-server --features="server"
fi
# Not all versions have a client example
if test -f examples/client/main.rs; then
cargo build --example ${package##*/}-client --features="client"
fi
# Test the CLI works if present
if test -f bin/cli.rs; then
cargo build --bin ${package##*/} --features cli
target/debug/${package##*/} --help
../../target/debug/${package##*/} --help
fi
# Test the validate feature if it exists
if cargo read-manifest | grep -q '"validate"'; then
Expand All @@ -77,4 +82,5 @@ jobs:
cargo test
cargo clippy
cargo doc
popd
done
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ tokio-openssl = "0.6"
openssl = "0.10"

[[example]]
name = "client"
name = "{{{packageName}}}-client"
path = "examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
name = "{{{packageName}}}-server"
path = "examples/server/main.rs"
required-features = ["server"]

[[bin]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ You'll find the binary at `target/release/cli`.
Run examples with:

```
cargo run --example <example-name>
cargo run --example {{{packageName}}}-<client|server>
```

To pass in arguments to the examples, put them after `--`, for example:

```
cargo run --example client -- --help
cargo run --example {{{packageName}}}-client -- --help
```

### Running the example server
To run the server, follow these simple steps:

```
cargo run --example server
cargo run --example {{{packageName}}}-server
```

### Running the example client
Expand All @@ -97,7 +97,7 @@ To run a client, follow one of the following simple steps:
{{#operation}}
{{#vendorExtensions}}
{{^x-no-client-example}}
cargo run --example client {{{operationId}}}
cargo run --example {{{packageName}}}-client {{{operationId}}}
{{/x-no-client-example}}
{{/vendorExtensions}}
{{/operation}}
Expand All @@ -110,7 +110,7 @@ cargo run --example client {{{operationId}}}
The examples can be run in HTTPS mode by passing in the flag `--https`, for example:

```
cargo run --example server -- --https
cargo run --example {{{packageName}}}-server -- --https
```

This will use the keys/certificates from the examples directory. Note that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ openssl = "0.10"
tokio-openssl = "0.6"

[[example]]
name = "client"
name = "{{{packageName}}}-client"
path = "examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
name = "{{{packageName}}}-server"
path = "examples/server/main.rs"
required-features = ["server"]

[[bin]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ You'll find the binary at `target/release/cli`.
Run examples with:

```
cargo run --example <example-name>
cargo run --example {{{packageName}}}-<client|server>
```

To pass in arguments to the examples, put them after `--`, for example:

```
cargo run --example client -- --help
cargo run --example {{{packageName}}}-client -- --help
```

### Running the example server
To run the server, follow these simple steps:

```
cargo run --example server
cargo run --example {{{packageName}}}-server
```

### Running the example client
Expand All @@ -97,7 +97,7 @@ To run a client, follow one of the following simple steps:
{{#operation}}
{{#exts}}
{{^x-no-client-example}}
cargo run --example client {{{operationId}}}
cargo run --example {{{packageName}}}-client {{{operationId}}}
{{/x-no-client-example}}
{{/exts}}
{{/operation}}
Expand All @@ -110,7 +110,7 @@ cargo run --example client {{{operationId}}}
The examples can be run in HTTPS mode by passing in the flag `--https`, for example:

```
cargo run --example server -- --https
cargo run --example {{{packageName}}}-server -- --https
```

This will use the keys/certificates from the examples directory. Note that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
match hdr_values.to_str() {
std::result::Result::Ok(hdr_values) => {
let hdr_values : std::vec::Vec<{{{classname}}}> = hdr_values
.split(',')
.split(", ")
.filter_map(|hdr_value| match hdr_value.trim() {
"" => std::option::Option::None,
hdr_value => std::option::Option::Some({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ tokio-openssl = "0.6"
openssl = "0.10"

[[example]]
name = "client"
name = "multipart-v3-client"
path = "examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
name = "multipart-v3-server"
path = "examples/server/main.rs"
required-features = ["server"]

[[bin]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,36 @@ You'll find the binary at `target/release/cli`.
Run examples with:

```
cargo run --example <example-name>
cargo run --example multipart-v3-<client|server>
```

To pass in arguments to the examples, put them after `--`, for example:

```
cargo run --example client -- --help
cargo run --example multipart-v3-client -- --help
```

### Running the example server
To run the server, follow these simple steps:

```
cargo run --example server
cargo run --example multipart-v3-server
```

### Running the example client
To run a client, follow one of the following simple steps:

```
cargo run --example client MultipartRelatedRequestPost
cargo run --example client MultipartRequestPost
cargo run --example client MultipleIdenticalMimeTypesPost
cargo run --example multipart-v3-client MultipartRelatedRequestPost
cargo run --example multipart-v3-client MultipartRequestPost
cargo run --example multipart-v3-client MultipleIdenticalMimeTypesPost
```

### HTTPS
The examples can be run in HTTPS mode by passing in the flag `--https`, for example:

```
cargo run --example server -- --https
cargo run --example multipart-v3-server -- --https
```

This will use the keys/certificates from the examples directory. Note that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ tokio-openssl = "0.6"
openssl = "0.10"

[[example]]
name = "client"
name = "no-example-v3-client"
path = "examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
name = "no-example-v3-server"
path = "examples/server/main.rs"
required-features = ["server"]

[[bin]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ You'll find the binary at `target/release/cli`.
Run examples with:

```
cargo run --example <example-name>
cargo run --example no-example-v3-<client|server>
```

To pass in arguments to the examples, put them after `--`, for example:

```
cargo run --example client -- --help
cargo run --example no-example-v3-client -- --help
```

### Running the example server
To run the server, follow these simple steps:

```
cargo run --example server
cargo run --example no-example-v3-server
```

### Running the example client
Expand All @@ -92,7 +92,7 @@ To run a client, follow one of the following simple steps:
The examples can be run in HTTPS mode by passing in the flag `--https`, for example:

```
cargo run --example server -- --https
cargo run --example no-example-v3-server -- --https
```

This will use the keys/certificates from the examples directory. Note that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ tokio-openssl = "0.6"
openssl = "0.10"

[[example]]
name = "client"
name = "openapi-v3-client"
path = "examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
name = "openapi-v3-server"
path = "examples/server/main.rs"
required-features = ["server"]

[[bin]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,64 +66,64 @@ You'll find the binary at `target/release/cli`.
Run examples with:

```
cargo run --example <example-name>
cargo run --example openapi-v3-<client|server>
```

To pass in arguments to the examples, put them after `--`, for example:

```
cargo run --example client -- --help
cargo run --example openapi-v3-client -- --help
```

### Running the example server
To run the server, follow these simple steps:

```
cargo run --example server
cargo run --example openapi-v3-server
```

### Running the example client
To run a client, follow one of the following simple steps:

```
cargo run --example client AnyOfGet
cargo run --example client CallbackWithHeaderPost
cargo run --example client ComplexQueryParamGet
cargo run --example client ExamplesTest
cargo run --example client FormTest
cargo run --example client GetWithBooleanParameter
cargo run --example client JsonComplexQueryParamGet
cargo run --example client MandatoryRequestHeaderGet
cargo run --example client MergePatchJsonGet
cargo run --example client MultigetGet
cargo run --example client MultipleAuthSchemeGet
cargo run --example client OneOfGet
cargo run --example client OverrideServerGet
cargo run --example client ParamgetGet
cargo run --example client ReadonlyAuthSchemeGet
cargo run --example client RegisterCallbackPost
cargo run --example client RequiredOctetStreamPut
cargo run --example client ResponsesWithHeadersGet
cargo run --example client Rfc7807Get
cargo run --example client TwoFirstLetterHeaders
cargo run --example client UntypedPropertyGet
cargo run --example client UuidGet
cargo run --example client XmlExtraPost
cargo run --example client XmlOtherPost
cargo run --example client XmlOtherPut
cargo run --example client XmlPost
cargo run --example client XmlPut
cargo run --example client EnumInPathPathParamGet
cargo run --example client MultiplePathParamsWithVeryLongPathToTestFormattingPathParamAPathParamBGet
cargo run --example client CreateRepo
cargo run --example client GetRepoInfo
cargo run --example openapi-v3-client AnyOfGet
cargo run --example openapi-v3-client CallbackWithHeaderPost
cargo run --example openapi-v3-client ComplexQueryParamGet
cargo run --example openapi-v3-client ExamplesTest
cargo run --example openapi-v3-client FormTest
cargo run --example openapi-v3-client GetWithBooleanParameter
cargo run --example openapi-v3-client JsonComplexQueryParamGet
cargo run --example openapi-v3-client MandatoryRequestHeaderGet
cargo run --example openapi-v3-client MergePatchJsonGet
cargo run --example openapi-v3-client MultigetGet
cargo run --example openapi-v3-client MultipleAuthSchemeGet
cargo run --example openapi-v3-client OneOfGet
cargo run --example openapi-v3-client OverrideServerGet
cargo run --example openapi-v3-client ParamgetGet
cargo run --example openapi-v3-client ReadonlyAuthSchemeGet
cargo run --example openapi-v3-client RegisterCallbackPost
cargo run --example openapi-v3-client RequiredOctetStreamPut
cargo run --example openapi-v3-client ResponsesWithHeadersGet
cargo run --example openapi-v3-client Rfc7807Get
cargo run --example openapi-v3-client TwoFirstLetterHeaders
cargo run --example openapi-v3-client UntypedPropertyGet
cargo run --example openapi-v3-client UuidGet
cargo run --example openapi-v3-client XmlExtraPost
cargo run --example openapi-v3-client XmlOtherPost
cargo run --example openapi-v3-client XmlOtherPut
cargo run --example openapi-v3-client XmlPost
cargo run --example openapi-v3-client XmlPut
cargo run --example openapi-v3-client EnumInPathPathParamGet
cargo run --example openapi-v3-client MultiplePathParamsWithVeryLongPathToTestFormattingPathParamAPathParamBGet
cargo run --example openapi-v3-client CreateRepo
cargo run --example openapi-v3-client GetRepoInfo
```

### HTTPS
The examples can be run in HTTPS mode by passing in the flag `--https`, for example:

```
cargo run --example server -- --https
cargo run --example openapi-v3-server -- --https
```

This will use the keys/certificates from the examples directory. Note that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ tokio-openssl = "0.6"
openssl = "0.10"

[[example]]
name = "client"
name = "ops-v3-client"
path = "examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
name = "ops-v3-server"
path = "examples/server/main.rs"
required-features = ["server"]

[[bin]]
Expand Down
Loading
Loading