OpenApiSpex.Parameter (open_api_spex v3.10.0) View Source
Defines the OpenApiSpex.Parameter.t type.
Link to this section Summary
Types
Valid values for the in key in the OpenApiSpex.Parameter struct.
Valid values for the style key in the OpenApiSpex.Parameter struct.
Functions
Sets the schema for a parameter from a simple type, reference or Schema
Gets the schema for a parameter, from the schema key or content key, which ever is populated.
Link to this section Types
Specs
location() :: :path | :query | :header | :cookie
Valid values for the in key in the OpenApiSpex.Parameter struct.
Specs
parameters() :: %{required(String.t()) => t() | OpenApiSpex.Reference.t()} | nil
Specs
style() :: :matrix | :label | :form | :simple | :spaceDelimited | :pipeDelimited | :deepObject
Valid values for the style key in the OpenApiSpex.Parameter struct.
Specs
t() :: %OpenApiSpex.Parameter{
allowEmptyValue: boolean() | nil,
allowReserved: boolean() | nil,
content: %{required(String.t()) => OpenApiSpex.MediaType.t()} | nil,
deprecated: boolean() | nil,
description: String.t() | nil,
example: any(),
examples:
%{
required(String.t()) =>
OpenApiSpex.Example.t() | OpenApiSpex.Reference.t()
}
| nil,
explode: boolean() | nil,
in: location(),
name: atom(),
required: boolean() | nil,
schema: OpenApiSpex.Schema.t() | OpenApiSpex.Reference.t() | atom() | nil,
style: style() | nil
}
Describes a single operation parameter.
A unique parameter is defined by a combination of a name and location.
Parameter Locations
There are four possible parameter locations specified by the in field:
- path: Used together with Path Templating, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in
/items/{itemId}, the path parameter is itemId. - query: Parameters that are appended to the URL. For example, in
/items?id=###, the query parameter is id. - header: Custom headers that are expected as part of the request. Note that RFC7230 states header names are case insensitive.
- cookie: Used to pass a specific cookie value to the API.
Link to this section Functions
Specs
put_schema(t(), OpenApiSpex.Reference.t() | OpenApiSpex.Schema.t() | atom()) :: t()
Sets the schema for a parameter from a simple type, reference or Schema
Specs
schema(t()) :: OpenApiSpex.Schema.t() | OpenApiSpex.Reference.t() | atom()
Gets the schema for a parameter, from the schema key or content key, which ever is populated.