nori/operation
Operation type for OpenAPI specifications.
Describes a single API operation on a path.
Types
A map of possible out-of-band callbacks. The key is a unique identifier for the callback.
pub type Callback =
dict.Dict(String, reference.Ref(PathItem))
Describes a single API operation on a path.
pub type Operation {
Operation(
tags: List(String),
summary: option.Option(String),
description: option.Option(String),
external_docs: option.Option(schema.ExternalDocumentation),
operation_id: option.Option(String),
parameters: List(reference.Ref(parameter.Parameter)),
request_body: option.Option(
reference.Ref(request_body.RequestBody),
),
responses: dict.Dict(String, reference.Ref(response.Response)),
callbacks: dict.Dict(
String,
reference.Ref(dict.Dict(String, reference.Ref(PathItem))),
),
deprecated: option.Option(Bool),
security: option.Option(List(dict.Dict(String, List(String)))),
servers: List(server.Server),
extensions: dict.Dict(String, json.Json),
)
}
Constructors
-
Operation( tags: List(String), summary: option.Option(String), description: option.Option(String), external_docs: option.Option(schema.ExternalDocumentation), operation_id: option.Option(String), parameters: List(reference.Ref(parameter.Parameter)), request_body: option.Option( reference.Ref(request_body.RequestBody), ), responses: dict.Dict(String, reference.Ref(response.Response)), callbacks: dict.Dict( String, reference.Ref(dict.Dict(String, reference.Ref(PathItem))), ), deprecated: option.Option(Bool), security: option.Option(List(dict.Dict(String, List(String)))), servers: List(server.Server), extensions: dict.Dict(String, json.Json), )Arguments
- tags
-
A list of tags for API documentation control.
- summary
-
A short summary of what the operation does.
- description
-
A verbose explanation of the operation behavior.
- external_docs
-
Additional external documentation for this operation.
- operation_id
-
Unique string used to identify the operation.
- parameters
-
A list of parameters applicable for this operation.
- request_body
-
The request body applicable for this operation.
- responses
-
The list of possible responses as returned from this operation.
- callbacks
-
A map of possible out-of band callbacks related to the operation.
- deprecated
-
Declares this operation to be deprecated.
- security
-
A declaration of which security mechanisms can be used for this operation.
- servers
-
An alternative server array to service this operation.
- extensions
-
Extension fields (x-*)
Path item that may be used for callbacks and webhooks. Forward declaration to avoid circular dependencies with paths.gleam.
pub type PathItem {
PathItem(
ref: option.Option(String),
summary: option.Option(String),
description: option.Option(String),
get: option.Option(Operation),
put: option.Option(Operation),
post: option.Option(Operation),
delete: option.Option(Operation),
options: option.Option(Operation),
head: option.Option(Operation),
patch: option.Option(Operation),
trace: option.Option(Operation),
servers: List(server.Server),
parameters: List(reference.Ref(parameter.Parameter)),
extensions: dict.Dict(String, json.Json),
)
}
Constructors
-
PathItem( ref: option.Option(String), summary: option.Option(String), description: option.Option(String), get: option.Option(Operation), put: option.Option(Operation), post: option.Option(Operation), delete: option.Option(Operation), options: option.Option(Operation), head: option.Option(Operation), patch: option.Option(Operation), trace: option.Option(Operation), servers: List(server.Server), parameters: List(reference.Ref(parameter.Parameter)), extensions: dict.Dict(String, json.Json), )
Tag metadata for grouping operations.
pub type Tag {
Tag(
name: String,
description: option.Option(String),
external_docs: option.Option(schema.ExternalDocumentation),
extensions: dict.Dict(String, json.Json),
)
}
Constructors
-
Tag( name: String, description: option.Option(String), external_docs: option.Option(schema.ExternalDocumentation), extensions: dict.Dict(String, json.Json), )Arguments
- name
-
The name of the tag.
- description
-
A description for the tag.
- external_docs
-
Additional external documentation for this tag.
- extensions
-
Extension fields (x-*)
Values
pub fn tag_with_description(
name: String,
description: String,
) -> Tag
Creates a Tag with name and description.