openapi-gen 0.3.1

Rust macro to generate client from OpenAPI spec.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use openapi_gen::openapi_client;

#[test]
fn custom_client_name() {
    openapi_client!("openapi.json", "TestApi");

    let _api = TestApi::new("");
}

#[test]
fn auto_generated_client_name() {
    openapi_client!("openapi.json");

    // The API title is "OpenAPI Client Test API" so it should generate "OpenApiClientTestApiApi"
    let _api = OpenApiClientTestApiApi::new("");
}