Skip to content

dsietz/actix-web-openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Actix Web OpenAPI

Version MIT/Apache-2.0


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.

About

Contract testing of an OpenAPI document for REST service running on Actix Web

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages