Skip to content

Commit cb0bee5

Browse files
committed
Ensure rust-server compiles with no-default-features
1 parent 578bdbe commit cb0bee5

File tree

17 files changed

+20
-20
lines changed

17 files changed

+20
-20
lines changed

.github/workflows/samples-rust-server.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ jobs:
3939
4040
- name: Build
4141
working-directory: ${{ matrix.sample }}
42-
run: cargo build --all-targets --all-features
42+
run: |
43+
set -e
44+
cargo build --all-targets --all-features
45+
cargo build --all-targets --no-default-features
4346
- name: Tests
4447
working-directory: ${{ matrix.sample }}
4548
run: |

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::collections::BTreeSet;
2-
use crate::server::Authorization;
32
use serde::{Deserialize, Serialize};
4-
use swagger::ApiError;
3+
use swagger::{ApiError, auth::Authorization};
54
use headers::authorization::{Basic, Bearer};
65
#[derive(Debug, Serialize, Deserialize)]
76
pub struct Claims {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ use mockall::automock;
88
use std::error::Error;
99
use std::collections::BTreeSet;
1010
use std::task::{Poll, Context};
11-
use swagger::{ApiError, ContextWrapper};
11+
use swagger::{ApiError, ContextWrapper, auth::Authorization};
1212
use serde::{Serialize, Deserialize};
13-
use crate::server::Authorization;
14-
1513

1614
type ServiceError = Box<dyn Error + Send + Sync + 'static>;
1715

samples/server/petstore/rust-server/output/multipart-v3/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::BTreeSet;
2-
use crate::server::Authorization;
2+
use swagger::auth::Authorization;
33
use serde::{Deserialize, Serialize};
44
use swagger::ApiError;
55
use headers::authorization::{Basic, Bearer};

samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::collections::BTreeSet;
1010
use std::task::{Poll, Context};
1111
use swagger::{ApiError, ContextWrapper};
1212
use serde::{Serialize, Deserialize};
13-
use crate::server::Authorization;
13+
use swagger::auth::Authorization;
1414

1515

1616
type ServiceError = Box<dyn Error + Send + Sync + 'static>;

samples/server/petstore/rust-server/output/no-example-v3/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::BTreeSet;
2-
use crate::server::Authorization;
2+
use swagger::auth::Authorization;
33
use serde::{Deserialize, Serialize};
44
use swagger::ApiError;
55
use headers::authorization::{Basic, Bearer};

samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::collections::BTreeSet;
1010
use std::task::{Poll, Context};
1111
use swagger::{ApiError, ContextWrapper};
1212
use serde::{Serialize, Deserialize};
13-
use crate::server::Authorization;
13+
use swagger::auth::Authorization;
1414

1515

1616
type ServiceError = Box<dyn Error + Send + Sync + 'static>;

samples/server/petstore/rust-server/output/openapi-v3/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::BTreeSet;
2-
use crate::server::Authorization;
2+
use swagger::auth::Authorization;
33
use serde::{Deserialize, Serialize};
44
use swagger::ApiError;
55
use headers::authorization::{Basic, Bearer};

samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::collections::BTreeSet;
1010
use std::task::{Poll, Context};
1111
use swagger::{ApiError, ContextWrapper};
1212
use serde::{Serialize, Deserialize};
13-
use crate::server::Authorization;
13+
use swagger::auth::Authorization;
1414

1515

1616
type ServiceError = Box<dyn Error + Send + Sync + 'static>;

samples/server/petstore/rust-server/output/ops-v3/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::BTreeSet;
2-
use crate::server::Authorization;
2+
use swagger::auth::Authorization;
33
use serde::{Deserialize, Serialize};
44
use swagger::ApiError;
55
use headers::authorization::{Basic, Bearer};

0 commit comments

Comments
 (0)