open_api_spex v1.1.3 OpenApiSpex.Operation View Source
Defines the OpenApiSpex.Operation.t
type.
Link to this section Summary
Functions
Cast params to the types defined by the schemas of the operation parameters and requestBody
Constructs an Operation struct from plug module and opts
Constructs an Operation struct from the plug and opts specified in the given route
Shorthand for constructing a Parameter name, location, type, description and optional examples
Shorthand for constructing a RequestBody with description, media_type, schema and optional examples
Shorthand for constructing a Response with description, media_type, schema and optional examples
Validate params against the schemas of the operation parameters and requestBody
Link to this section Types
t() :: %OpenApiSpex.Operation{callbacks: %{optional(String.t) => OpenApiSpex.Callback.t | OpenApiSpex.Reference.t} | nil, deprecated: boolean | nil, description: String.t | nil, externalDocs: OpenApiSpex.ExternalDocumentation.t | nil, operationId: String.t | nil, parameters: [OpenApiSpex.Parameter.t | OpenApiSpex.Reference.t] | nil, requestBody: [OpenApiSpex.RequestBody.t | OpenApiSpex.Reference.t] | nil, responses: OpenApiSpex.Responses.t, security: [OpenApiSpex.SecurityRequirement.t] | nil, servers: [OpenApiSpex.Server.t] | nil, summary: String.t | nil, tags: [String.t] | nil}
Describes a single API operation on a path.
Link to this section Functions
cast(OpenApiSpex.Operation.t, map, String.t | nil, %{optional(String.t) => OpenApiSpex.Schema.t}) :: {:ok, map} | {:error, String.t}
Cast params to the types defined by the schemas of the operation parameters and requestBody
Constructs an Operation struct from plug module and opts
Constructs an Operation struct from the plug and opts specified in the given route
parameter(atom, OpenApiSpex.Parameter.location, OpenApiSpex.Reference.t | OpenApiSpex.Schema.t | atom, String.t, keyword) :: OpenApiSpex.Parameter.t
Shorthand for constructing a Parameter name, location, type, description and optional examples
request_body(String.t, String.t, OpenApiSpex.Schema.t | OpenApiSpex.Reference.t | module, keyword) :: OpenApiSpex.RequestBody.t
Shorthand for constructing a RequestBody with description, media_type, schema and optional examples
response(String.t, String.t, OpenApiSpex.Schema.t | OpenApiSpex.Reference.t | module, keyword) :: OpenApiSpex.Response.t
Shorthand for constructing a Response with description, media_type, schema and optional examples
validate(OpenApiSpex.Operation.t, map, String.t | nil, %{optional(String.t) => OpenApiSpex.Schema.t}) :: :ok | {:error, String.t}
Validate params against the schemas of the operation parameters and requestBody