mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-22 20:52:27 +00:00
introduce without-openapi feature to improve #4
This commit is contained in:
parent
b7a1193333
commit
daea3ba9ec
4 changed files with 17 additions and 5 deletions
|
@ -20,7 +20,7 @@ test-default:
|
|||
- cargo/
|
||||
- target/
|
||||
|
||||
test-all:
|
||||
test-full:
|
||||
stage: test
|
||||
image: rust:1.42-slim
|
||||
before_script:
|
||||
|
@ -28,7 +28,7 @@ test-all:
|
|||
- apt install -y --no-install-recommends libpq-dev
|
||||
- cargo -V
|
||||
script:
|
||||
- cargo test --workspace --all-features
|
||||
- cargo test --no-default-features --features full
|
||||
cache:
|
||||
key: cargo-1-42-all
|
||||
paths:
|
||||
|
@ -64,7 +64,7 @@ test-trybuild-ui:
|
|||
- apt install -y --no-install-recommends libpq-dev
|
||||
- cargo -V
|
||||
script:
|
||||
- cargo test --workspace --all-features --tests -- --ignored
|
||||
- cargo test --no-default-features --features full --tests -- --ignored
|
||||
cache:
|
||||
key: cargo-1-48-all
|
||||
paths:
|
||||
|
|
|
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Changed
|
||||
- The cors handler can now copy headers from the request if desired
|
||||
- All fields of `Response` are now private
|
||||
- If not enabling the `openapi` feature, `without-openapi` has to be enabled
|
||||
|
||||
## [0.1.1] - 2020-12-28
|
||||
### Added
|
||||
|
|
|
@ -46,11 +46,16 @@ thiserror = "1.0.18"
|
|||
trybuild = "1.0.27"
|
||||
|
||||
[features]
|
||||
default = ["cors", "errorlog"]
|
||||
default = ["cors", "errorlog", "without-openapi"]
|
||||
full = ["auth", "cors", "database", "errorlog", "openapi"]
|
||||
|
||||
auth = ["gotham_restful_derive/auth", "base64", "cookie", "jsonwebtoken"]
|
||||
cors = []
|
||||
errorlog = []
|
||||
database = ["gotham_restful_derive/database", "gotham_middleware_diesel"]
|
||||
errorlog = []
|
||||
|
||||
# These features are exclusive - https://gitlab.com/msrd0/gotham-restful/-/issues/4
|
||||
without-openapi = []
|
||||
openapi = ["gotham_restful_derive/openapi", "indexmap", "openapiv3"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
|
|
@ -378,6 +378,12 @@ directory, that might help you. Any help writing more examples is highly appreci
|
|||
[`State`]: ../gotham/state/struct.State.html
|
||||
*/
|
||||
|
||||
#[cfg(all(feature = "openapi", feature = "without-openapi"))]
|
||||
compile_error!("The 'openapi' and 'without-openapi' features cannot be combined");
|
||||
|
||||
#[cfg(all(not(feature = "openapi"), not(feature = "without-openapi")))]
|
||||
compile_error!("Either the 'openapi' or 'without-openapi' feature needs to be enabled");
|
||||
|
||||
// weird proc macro issue
|
||||
extern crate self as gotham_restful;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue