Struct oas_gen::Oas3Builder[][src]

pub struct Oas3Builder { /* fields omitted */ }

Implementations

This variant accepts a test spec

use oas_gen::xtests::{Test,Response};
let mut params = std::collections::BTreeMap::default();
params.insert("key".to_owned(), "8472".to_owned());
let test_ok = Test {
    description: "Fetch a document by key.".to_owned(),
    response: Response {
        status: vec![200],
        ..Response::default()
    },
    params,
    ..Test::default()
};
assert_eq!(r#"{"description":"Fetch a document by key.","params":{"key":"8472"},"response":{"status":[200]}}"#, serde_json::to_string(&test_ok).unwrap());
let tests = vec![test_ok];

Create a http bearer Auth security scheme

let mut security_schemes: Map<String, RefOr<SecurityScheme>> = Map::default();
let security_scheme = create_bearer_scheme();
security_schemes.insert("bearerAuth".to_owned(), RefOr::Object(security_scheme));

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.