Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -579,7 +579,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Comment thread
dsteeley marked this conversation as resolved.
impl std::convert::TryFrom<header::IntoHeaderValue<Vec<{{{classname}}}>>> for hyper::header::HeaderValue {
type Error = String;

Expand All @@ -595,7 +595,7 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Vec<{{{classname}}}>>> for hy
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Vec<{{{classname}}}>> {
type Error = String;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,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 @@ -629,7 +629,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<header::IntoHeaderValue<Vec<{{{classname}}}>>> for hyper::header::HeaderValue {
type Error = String;

Expand All @@ -645,7 +645,7 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Vec<{{{classname}}}>>> for hy
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Vec<{{{classname}}}>> {
type Error = String;

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 @@ -137,7 +137,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Comment thread
dsteeley marked this conversation as resolved.
impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipartRelatedRequest>>> for hyper::header::HeaderValue {
type Error = String;

Expand All @@ -153,7 +153,7 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipartRelatedRequest>>
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Vec<MultipartRelatedRequest>> {
type Error = String;

Expand Down Expand Up @@ -307,7 +307,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipartRequestObjectField>>> for hyper::header::HeaderValue {
type Error = String;

Expand All @@ -323,7 +323,7 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipartRequestObjectFie
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Vec<MultipartRequestObjectField>> {
type Error = String;

Expand Down Expand Up @@ -471,7 +471,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipleIdenticalMimeTypesPostRequest>>> for hyper::header::HeaderValue {
type Error = String;

Expand All @@ -487,7 +487,7 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipleIdenticalMimeType
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Vec<MultipleIdenticalMimeTypesPostRequest>> {
type Error = String;

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 @@ -120,7 +120,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Comment thread
dsteeley marked this conversation as resolved.
impl std::convert::TryFrom<header::IntoHeaderValue<Vec<OpGetRequest>>> for hyper::header::HeaderValue {
type Error = String;

Expand All @@ -136,7 +136,7 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Vec<OpGetRequest>>> for hyper
}
}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Vec<OpGetRequest>> {
type Error = String;

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
Loading
Loading