nori/paths
Paths types for OpenAPI specifications.
Holds the relative paths to individual endpoints.
Types
Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object to construct the full URL.
pub type Paths =
dict.Dict(String, reference.Ref(operation.PathItem))
Values
pub fn add(
paths: dict.Dict(String, reference.Ref(operation.PathItem)),
path: String,
item: operation.PathItem,
) -> dict.Dict(String, reference.Ref(operation.PathItem))
Adds a path item to the paths.
pub fn add_ref(
paths: dict.Dict(String, reference.Ref(operation.PathItem)),
path: String,
ref: String,
) -> dict.Dict(String, reference.Ref(operation.PathItem))
Adds a path item reference to the paths.
pub fn delete(op: operation.Operation) -> operation.PathItem
Creates a PathItem with a DELETE operation.
pub fn get(op: operation.Operation) -> operation.PathItem
Creates a PathItem with a GET operation.
pub fn get_operations(
item: operation.PathItem,
) -> List(#(String, operation.Operation))
Gets all operations from a path item as a list of tuples (method, operation).
pub fn new() -> dict.Dict(
String,
reference.Ref(operation.PathItem),
)
Creates an empty Paths dictionary.
pub fn patch(op: operation.Operation) -> operation.PathItem
Creates a PathItem with a PATCH operation.
pub fn post(op: operation.Operation) -> operation.PathItem
Creates a PathItem with a POST operation.
pub fn put(op: operation.Operation) -> operation.PathItem
Creates a PathItem with a PUT operation.
pub fn with_delete(
item: operation.PathItem,
op: operation.Operation,
) -> operation.PathItem
Adds a DELETE operation to an existing path item.
pub fn with_description(
item: operation.PathItem,
desc: String,
) -> operation.PathItem
Sets the description on a path item.
pub fn with_get(
item: operation.PathItem,
op: operation.Operation,
) -> operation.PathItem
Adds a GET operation to an existing path item.
pub fn with_parameters(
item: operation.PathItem,
params: List(reference.Ref(parameter.Parameter)),
) -> operation.PathItem
Adds parameters to a path item.
pub fn with_patch(
item: operation.PathItem,
op: operation.Operation,
) -> operation.PathItem
Adds a PATCH operation to an existing path item.
pub fn with_post(
item: operation.PathItem,
op: operation.Operation,
) -> operation.PathItem
Adds a POST operation to an existing path item.
pub fn with_put(
item: operation.PathItem,
op: operation.Operation,
) -> operation.PathItem
Adds a PUT operation to an existing path item.
pub fn with_servers(
item: operation.PathItem,
srvs: List(server.Server),
) -> operation.PathItem
Adds servers to a path item.
pub fn with_summary(
item: operation.PathItem,
summ: String,
) -> operation.PathItem
Sets the summary on a path item.