[][src]Struct oas_gen::Oas3Builder

pub struct Oas3Builder { /* fields omitted */ }

Implementations

impl Oas3Builder[src]

pub fn any<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    method: Method,
    document_name: String,
    operation_name: &str,
    operation_description: Option<String>
)
[src]

pub fn any_with_tests<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    method: Method,
    document_name: String,
    operation_name: &str,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

impl Oas3Builder[src]

pub fn create<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn create_with_tests<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

impl Oas3Builder[src]

pub fn delete<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn delete_with_tests<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

pub fn delete_by_key<O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn delete_by_key_with_tests<O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

impl Oas3Builder[src]

pub fn fetch<O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn fetch_with_tests<O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

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];

impl Oas3Builder[src]

pub fn list<O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn list_with_tests<O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

impl Oas3Builder[src]

pub fn replace<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn replace_with_tests<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

impl Oas3Builder[src]

pub fn update<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>
)
[src]

pub fn update_with_tests<I: JsonSchema + Serialize, O: JsonSchema + Serialize, E: JsonSchema + Serialize>(
    &mut self,
    web_path: &ApiPath,
    document_name: String,
    operation_description: Option<String>,
    tests: &[Test]
)
[src]

impl Oas3Builder[src]

#[must_use]pub fn new() -> Self[src]

#[must_use]pub fn build(self, version: String) -> OpenApi[src]

#[must_use]pub fn create_bearer_scheme() -> SecurityScheme[src]

Create a http bearer Auth security scheme

#[must_use]pub fn build_with_security(
    self,
    version: String,
    security_schemes: Map<String, RefOr<SecurityScheme>>
) -> OpenApi
[src]

This example is not tested
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

impl Clone for Oas3Builder[src]

impl Debug for Oas3Builder[src]

impl Default for Oas3Builder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.