https://github.com/dsietz/actix-web-openapi
Contract testing of an OpenAPI document for REST service running on Actix Web
https://github.com/dsietz/actix-web-openapi
actix-web openapi openapi3 rust-lang testing web
Last synced: 10 months ago
JSON representation
Contract testing of an OpenAPI document for REST service running on Actix Web
- Host: GitHub
- URL: https://github.com/dsietz/actix-web-openapi
- Owner: dsietz
- License: apache-2.0
- Created: 2019-04-22T16:13:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T16:29:06.000Z (almost 7 years ago)
- Last Synced: 2025-04-09T21:52:09.735Z (10 months ago)
- Topics: actix-web, openapi, openapi3, rust-lang, testing, web
- Language: Rust
- Size: 29.3 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Actix Web OpenAPI


---
## Usage
```
extern crate actix_web_openapi;
fn main() {
match actix_web_openapi::from_path("./data/v3.0/petstore.yaml") {
Ok(spec) => {
let servers = spec.servers.unwrap();
for server in servers.iter() {
match server.to_client_request().finish() {
Ok(client) => {
assert_eq!(client.uri().scheme_str(), Some("http"));
assert_eq!(client.uri().host(), Some("petstore.swagger.io"));
assert_eq!(client.uri().port_u16(), None);
assert_eq!(client.uri().path(), "/v1");
},
Err(_err) => assert!(false),
}
}
},
Err(_err) => assert!(false),
}
}
```
## License
This soltuion uses open source products and is constrained to the inherited license agreements.
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)