zio.blocks.openapi

Members list

Type members

Classlikes

Attributes

Companion
trait
Source
OpenAPI.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait APIKeyLocation

The location of the API key for API key authentication.

The location of the API key for API key authentication.

Valid values are "query", "header", or "cookie".

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Cookie
object Header
object Query
case object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

Attributes

Source
BuildInfo.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
BuildInfo.type
final case class Callback(callbacks: ChunkMap[String, ReferenceOr[PathItem]] = ..., extensions: ChunkMap[String, Json] = ...)

A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.

A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.

To describe incoming requests from the API provider independent from another API call, use the webhooks field.

Value parameters

callbacks

A map of runtime expressions to Path Item Objects. The key is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Callback

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Callback.type
final case class Components(schemas: ChunkMap[String, ReferenceOr[SchemaObject]] = ..., responses: ChunkMap[String, ReferenceOr[Response]] = ..., parameters: ChunkMap[String, ReferenceOr[Parameter]] = ..., examples: ChunkMap[String, ReferenceOr[Example]] = ..., requestBodies: ChunkMap[String, ReferenceOr[RequestBody]] = ..., headers: ChunkMap[String, ReferenceOr[Header]] = ..., securitySchemes: ChunkMap[String, ReferenceOr[SecurityScheme]] = ..., links: ChunkMap[String, ReferenceOr[Link]] = ..., callbacks: ChunkMap[String, ReferenceOr[Callback]] = ..., pathItems: ChunkMap[String, ReferenceOr[PathItem]] = ..., extensions: ChunkMap[String, Json] = ...)

Holds a set of reusable objects for different aspects of the OAS.

Holds a set of reusable objects for different aspects of the OAS.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Components

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Components.type
object Contact

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Contact.type
final case class Contact(name: Option[String] = ..., url: Option[String] = ..., email: Option[String] = ..., extensions: ChunkMap[String, Json] = ...)

Contact information for the exposed API.

Contact information for the exposed API.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Encoding(contentType: Option[String] = ..., headers: ChunkMap[String, ReferenceOr[Header]] = ..., style: Option[String] = ..., explode: Option[Boolean] = ..., allowReserved: Boolean = ..., extensions: ChunkMap[String, Json] = ...)

A single encoding definition applied to a single schema property.

A single encoding definition applied to a single schema property.

Value parameters

allowReserved

Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding. The default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored.

contentType

The Content-Type for encoding a specific property. Default value depends on the property type: for object - application/json; for array – the default is defined based on the inner type; for all other cases the default is application/octet-stream. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/wildcard), or a comma-separated list of the two types.

explode

When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

headers

A map allowing additional information to be provided as headers, for example Content-Disposition. Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart.

style

Describes how a specific property value will be serialized depending on its type. See Parameter Object for details on the style property. The behavior follows the same values as query parameters, including default values. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data. If a value is explicitly defined, then the value of contentType (implicit or explicit) SHALL be ignored.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Encoding

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Encoding.type
final case class Example(summary: Option[Doc] = ..., description: Option[Doc] = ..., value: Option[Json] = ..., externalValue: Option[String] = ..., extensions: ChunkMap[String, Json] = ...)

An object representing an example.

An object representing an example.

In all cases, the example value is expected to be compatible with the type schema of its associated value. Tooling implementations MAY choose to validate compatibility automatically, and reject the example value if incompatible.

Value parameters

description

Long description for the example. CommonMark syntax MAY be used for rich text representation.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

externalValue

A URI that identifies the location of the example value. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive. See the rules for resolving Relative References.

summary

Short description for the example.

value

Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot be represented in JSON or YAML naturally, use a string value to contain the example, escaping where necessary.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Example

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Example.type
final case class ExternalDocumentation(url: String, description: Option[Doc] = ..., extensions: ChunkMap[String, Json] = ...)

Allows referencing an external resource for extended documentation.

Allows referencing an external resource for extended documentation.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class Header(description: Option[Doc] = ..., required: Boolean = ..., deprecated: Boolean = ..., allowEmptyValue: Boolean = ..., style: Option[String] = ..., explode: Option[Boolean] = ..., allowReserved: Option[Boolean] = ..., schema: Option[ReferenceOr[SchemaObject]] = ..., example: Option[Json] = ..., examples: ChunkMap[String, ReferenceOr[Example]] = ..., content: ChunkMap[String, MediaType] = ..., extensions: ChunkMap[String, Json] = ...)

The Header Object follows the structure of the Parameter Object with the following changes:

The Header Object follows the structure of the Parameter Object with the following changes:

  1. name MUST NOT be specified, it is given in the corresponding headers map.
  2. in MUST NOT be specified, it is implicitly in header.
  3. All traits that are affected by the location MUST be applicable to a location of header (for example, style).

Value parameters

allowEmptyValue

Sets the ability to pass empty-valued headers. Default value is false.

allowReserved

Determines whether the header value SHOULD allow reserved characters, as defined by RFC3986, to be included without percent-encoding.

content

A map containing the representations for the header. The key is the media type and the value describes it.

deprecated

Specifies that a header is deprecated and SHOULD be transitioned out of usage. Default value is false.

description

A brief description of the header. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.

example

Example of the header's potential value.

examples

Examples of the header's potential value.

explode

When this is true, header values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

required

Determines whether this header is mandatory. Default value is false.

schema

The schema defining the type used for the header.

style

Describes how the header value will be serialized.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Header

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Header.type
object Info

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Info.type
final case class Info(title: String, version: String, summary: Option[Doc] = ..., description: Option[Doc] = ..., termsOfService: Option[String] = ..., contact: Option[Contact] = ..., license: Option[License] = ..., extensions: ChunkMap[String, Json] = ...)

The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.

The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class License(name: String, identifier: Option[String] = ..., url: Option[String] = ..., extensions: ChunkMap[String, Json] = ...)

License information for the exposed API. Optional SPDX license expression (identifier) and a URL to the license are mutually exclusive per the OpenAPI spec.

License information for the exposed API. Optional SPDX license expression (identifier) and a URL to the license are mutually exclusive per the OpenAPI spec.

Value parameters

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

identifier

An optional SPDX license expression (identifier)

name

REQUIRED. The license name used for the API.

url

An optional URL to the license.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object License

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
License.type
final case class Link(operationRef: Option[String] = ..., operationId: Option[String] = ..., parameters: ChunkMap[String, Json] = ..., requestBody: Option[Json] = ..., description: Option[Doc] = ..., server: Option[Server] = ..., extensions: ChunkMap[String, Json] = ...)

The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

Unlike dynamic links (i.e. links provided in the response payload), the OAS linking mechanism does not require link information in the runtime response.

For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation.

Value parameters

description

A description of the link. CommonMark syntax MAY be used for rich text representation.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

operationId

A name of an existing, resolvable OAS operation (operationId), mutually exclusive with operationRef.

operationRef

An optional absolute URI reference to an OAS operation (operationRef), mutually exclusive with operationId.

parameters

A map representing parameters to pass to an operation as specified with operationId or identified via operationRef. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the parameter location [{in}.]{name} for operations that use the same parameter name in different locations (e.g. path.id).

requestBody

A literal value or {expression} to use as a request body when calling the target operation.

server

A server object to be used by the target operation.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Link

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Link.type
final case class MediaType(schema: Option[ReferenceOr[SchemaObject]] = ..., example: Option[Json] = ..., examples: ChunkMap[String, ReferenceOr[Example]] = ..., encoding: ChunkMap[String, Encoding] = ..., extensions: ChunkMap[String, Json] = ...)

Each Media Type Object provides schema and examples for the media type identified by its key.

Each Media Type Object provides schema and examples for the media type identified by its key.

Value parameters

encoding

A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded.

example

Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema.

examples

Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The examples field is mutually exclusive of the example field. Furthermore, if referencing a schema which contains an example, the examples value SHALL override the example provided by the schema.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

schema

The schema defining the content of the request, response, or parameter.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object MediaType

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
MediaType.type
final case class OAuthFlow(authorizationUrl: Option[String] = ..., tokenUrl: Option[String] = ..., refreshUrl: Option[String] = ..., scopes: ChunkMap[String, String] = ..., extensions: ChunkMap[String, Json] = ...)

Configuration details for a supported OAuth Flow.

Configuration details for a supported OAuth Flow.

Value parameters

authorizationUrl

The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. REQUIRED for implicit and authorizationCode flows.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

refreshUrl

The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

scopes

REQUIRED. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.

tokenUrl

The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS. REQUIRED for password, clientCredentials, and authorizationCode flows.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object OAuthFlow

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
OAuthFlow.type
object OAuthFlows

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
OAuthFlows.type
final case class OAuthFlows(`implicit`: Option[OAuthFlow] = ..., password: Option[OAuthFlow] = ..., clientCredentials: Option[OAuthFlow] = ..., authorizationCode: Option[OAuthFlow] = ..., extensions: ChunkMap[String, Json] = ...)

Allows configuration of the supported OAuth Flows.

Allows configuration of the supported OAuth Flows.

Value parameters

`implicit`

Configuration for the OAuth Implicit flow.

authorizationCode

Configuration for the OAuth Authorization Code flow. Previously called accessCode in OAuth2.

clientCredentials

Configuration for the OAuth Client Credentials flow. Previously called application in OAuth2.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

password

Configuration for the OAuth Resource Owner Password flow.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class OpenAPI(openapi: String, info: Info, jsonSchemaDialect: Option[String] = ..., servers: Chunk[Server] = ..., paths: Option[Paths] = ..., webhooks: ChunkMap[String, ReferenceOr[PathItem]] = ..., components: Option[Components] = ..., security: Chunk[SecurityRequirement] = ..., tags: Chunk[Tag] = ..., externalDocs: Option[ExternalDocumentation] = ..., extensions: ChunkMap[String, Json] = ...)

The root object of an OpenAPI 3.1 document.

The root object of an OpenAPI 3.1 document.

Value parameters

components

An element to hold various schemas for the document.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

externalDocs

Additional external documentation.

info

REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.

jsonSchemaDialect

The default value for the $$schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI.

openapi

REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI document.

paths

The available paths and operations for the API.

security

A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used.

servers

An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /.

tags

A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object OpenAPI

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
OpenAPI.type
object OpenAPICodec

Attributes

Source
OpenAPICodec.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object OpenAPIGen

Attributes

Source
OpenAPIGen.scala
Supertypes
class Object
trait Matchable
class Any
Self type
OpenAPIGen.type
object Operation

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Operation.type
final case class Operation(responses: Responses = ..., tags: Chunk[String] = ..., summary: Option[Doc] = ..., description: Option[Doc] = ..., externalDocs: Option[ExternalDocumentation] = ..., operationId: Option[String] = ..., parameters: Chunk[ReferenceOr[Parameter]] = ..., requestBody: Option[ReferenceOr[RequestBody]] = ..., callbacks: ChunkMap[String, ReferenceOr[Callback]] = ..., deprecated: Boolean = ..., security: Chunk[SecurityRequirement] = ..., servers: Chunk[Server] = ..., extensions: ChunkMap[String, Json] = ...)

Describes a single API operation on a path.

Describes a single API operation on a path.

Value parameters

callbacks

A map of possible out-of band callbacks related to the parent operation.

deprecated

Declares this operation to be deprecated.

description

A verbose explanation of the operation behavior.

extensions

Extension fields starting with x-.

externalDocs

Additional external documentation for this operation.

operationId

Unique string used to identify the operation.

parameters

A list of parameters that are applicable for this operation.

requestBody

The request body applicable for this operation.

responses

REQUIRED. The list of possible responses as they are returned from executing this operation.

security

A declaration of which security mechanisms can be used for this operation.

servers

An alternative server array to service this operation.

summary

A short summary of what the operation does.

tags

A list of tags for API documentation control.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Parameter(name: String, in: ParameterLocation, description: Option[Doc] = ..., required: Boolean = ..., deprecated: Boolean = ..., allowEmptyValue: Boolean = ..., style: Option[String] = ..., explode: Option[Boolean] = ..., allowReserved: Option[Boolean] = ..., schema: Option[ReferenceOr[SchemaObject]] = ..., example: Option[Json] = ..., examples: ChunkMap[String, ReferenceOr[Example]] = ..., content: ChunkMap[String, MediaType] = ..., extensions: ChunkMap[String, Json] = ...)

Describes a single operation parameter.

Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location.

Note: If the parameter location is "path", the required field MUST be true. This is not enforced in the constructor; callers are responsible for ensuring path parameters have required=true.

Value parameters

allowEmptyValue

Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false.

allowReserved

Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986, to be included without percent-encoding.

content

A map containing the representations for the parameter. The key is the media type and the value describes it.

deprecated

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false.

description

A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.

example

Example of the parameter's potential value. The example SHOULD match the specified schema and encoding properties if present.

examples

Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding.

explode

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

in

REQUIRED. The location of the parameter.

name

REQUIRED. The name of the parameter. Parameter names are case sensitive.

required

Determines whether this parameter is mandatory. If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false.

schema

The schema defining the type used for the parameter.

style

Describes how the parameter value will be serialized depending on the type of the parameter value.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Parameter

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Parameter.type
sealed trait ParameterLocation

The location of the parameter.

The location of the parameter.

Possible values are "query", "header", "path" or "cookie".

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Cookie
object Header
object Path
object Query

Attributes

Companion
trait
Source
OpenAPI.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class PathItem(summary: Option[Doc] = ..., description: Option[Doc] = ..., get: Option[Operation] = ..., put: Option[Operation] = ..., post: Option[Operation] = ..., delete: Option[Operation] = ..., options: Option[Operation] = ..., head: Option[Operation] = ..., patch: Option[Operation] = ..., trace: Option[Operation] = ..., servers: Chunk[Server] = ..., parameters: Chunk[ReferenceOr[Parameter]] = ..., extensions: ChunkMap[String, Json] = ...)

Describes the operations available on a single path.

Describes the operations available on a single path.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object PathItem

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
PathItem.type
object Paths

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Paths.type
final case class Paths(paths: ChunkMap[String, PathItem] = ..., extensions: ChunkMap[String, Json] = ...)

Holds the relative paths to the individual endpoints and their operations.

Holds the relative paths to the individual endpoints and their operations.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Reference($ref: String, summary: Option[Doc] = ..., description: Option[Doc] = ...)

A simple object to allow referencing other components in the OpenAPI document, internally and externally.

A simple object to allow referencing other components in the OpenAPI document, internally and externally.

Value parameters

`$$ref`

REQUIRED. The reference identifier. This MUST be in the form of a URI.

description

A description which by default SHOULD override that of the referenced component.

summary

A short summary which by default SHOULD override that of the referenced component.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Reference

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Reference.type
sealed trait ReferenceOr[+A]

A type that can either be a Reference or a concrete value of type A. This pattern is used extensively in OpenAPI 3.1 to allow reusable components.

A type that can either be a Reference or a concrete value of type A. This pattern is used extensively in OpenAPI 3.1 to allow reusable components.

Type parameters

A

The type of the concrete value when not using a reference.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Ref
class Value[A]
object ReferenceOr

Attributes

Companion
trait
Source
OpenAPI.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class RequestBody(content: ChunkMap[String, MediaType], description: Option[Doc] = ..., required: Boolean = ..., extensions: ChunkMap[String, Json] = ...)

Describes a single request body.

Describes a single request body.

Value parameters

content

REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/wildcard

description

A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

required

Determines if the request body is required in the request. Defaults to false.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object RequestBody

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Response

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Response.type
final case class Response(description: Doc, headers: ChunkMap[String, ReferenceOr[Header]] = ..., content: ChunkMap[String, MediaType] = ..., links: ChunkMap[String, ReferenceOr[Link]] = ..., extensions: ChunkMap[String, Json] = ...)

Describes a single response from an API Operation, including design-time, static links to operations based on the response.

Describes a single response from an API Operation, including design-time, static links to operations based on the response.

Value parameters

content

A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/wildcard

description

REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text representation.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

headers

Maps a header name to its definition. RFC7230 states header names are case insensitive. If a response header is defined with the name "Content-Type", it SHALL be ignored.

links

A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for Component Objects.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Responses

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Responses.type
final case class Responses(responses: ChunkMap[String, ReferenceOr[Response]] = ..., default: Option[ReferenceOr[Response]] = ..., extensions: ChunkMap[String, Json] = ...)

A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.

A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.

The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors.

The default MAY be used as a default response object for all HTTP codes that are not covered individually by the Responses Object.

Value parameters

default

The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

responses

A map of HTTP status codes to Response objects. The key is the HTTP status code as a string (e.g. "200", "404", "4XX"). The value is a Response or Reference.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SchemaObject(jsonSchema: Json, discriminator: Option[Discriminator] = ..., xml: Option[XML] = ..., externalDocs: Option[ExternalDocumentation] = ..., example: Option[Json] = ..., extensions: ChunkMap[String, Json] = ...)

The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.

The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.

In OpenAPI 3.1, the Schema Object is fully compatible with JSON Schema 2020-12, with the addition of OpenAPI-specific vocabulary.

This implementation wraps the existing JsonSchema from zio-blocks-schema and adds OpenAPI-specific vocabulary fields.

Value parameters

discriminator

Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description.

example

A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary. Deprecated: The example property has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

externalDocs

Additional external documentation for this schema.

jsonSchema

The underlying JSON Schema 2020-12 schema represented as Json. This contains all standard JSON Schema keywords (type, properties, items, etc.).

xml

This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object SchemaObject

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final implicit class SchemaOps[A](self: Schema[A]) extends AnyVal

Enriches Schema[A] with OpenAPI-specific operations.

Enriches Schema[A] with OpenAPI-specific operations.

Attributes

Source
package.scala
Supertypes
class AnyVal
trait Matchable
class Any

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class SecurityRequirement(requirements: ChunkMap[String, Chunk[String]])

Lists the required security schemes to execute this operation.

Lists the required security schemes to execute this operation.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
trait
Source
OpenAPI.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait SecurityScheme

Defines a security scheme that can be used by the operations.

Defines a security scheme that can be used by the operations.

Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, client credentials and authorization code) as defined in RFC6749, and OpenID Connect Discovery.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class APIKey
class HTTP
class MutualTLS
class OAuth2
final case class Server(url: String, description: Option[Doc] = ..., variables: ChunkMap[String, ServerVariable] = ..., extensions: ChunkMap[String, Json] = ...)

An object representing a Server.

An object representing a Server.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Server

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Server.type

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class ServerVariable(default: String, enum: Chunk[String] = ..., description: Option[Doc] = ..., extensions: ChunkMap[String, Json] = ...)

Creates a ServerVariable with validation. If enum is non-empty, the default value MUST be one of the enum values.

Creates a ServerVariable with validation. If enum is non-empty, the default value MUST be one of the enum values.

Value parameters

default

REQUIRED. The default value to use for substitution.

description

An optional description for the server variable.

enum

An enumeration of string values to be used if the substitution options are from a limited set.

extensions

Specification extensions (x-* fields).

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Tag(name: String, description: Option[Doc] = ..., externalDocs: Option[ExternalDocumentation] = ..., extensions: ChunkMap[String, Json] = ...)

Adds metadata to a single tag that is used by the Operation Object.

Adds metadata to a single tag that is used by the Operation Object.

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Tag

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Tag.type
final case class XML(name: Option[String] = ..., namespace: Option[String] = ..., prefix: Option[String] = ..., attribute: Boolean = ..., wrapped: Boolean = ...)

A metadata object that allows for more fine-tuned XML model definitions.

A metadata object that allows for more fine-tuned XML model definitions.

When using arrays, XML element names are not inferred (for singular/plural forms) and the name property SHOULD be used to add that information.

Value parameters

attribute

Declares whether the property definition translates to an attribute instead of an element. Default value is false.

name

Replaces the name of the element/attribute used for the described schema property. When defined within items, it will affect the name of the individual XML elements within the list. When defined alongside type being arrayed (outside the items), it will affect the wrapping element and only if wrapped is true. If wrapped is false, it will be ignored.

namespace

The URI of the namespace definition. This MUST be in the form of an absolute URI.

prefix

The prefix to be used for the name.

wrapped

MAY be used only for an array definition. Signifies whether the array is wrapped (for example, ) or unwrapped (). Default value is false. The definition takes effect only when defined alongside type being arrayed (outside the items).

Attributes

Companion
object
Source
OpenAPI.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object XML

Attributes

Companion
class
Source
OpenAPI.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
XML.type

Types

Attributes

Source
package.scala

Value members

Concrete fields

Attributes

Source
package.scala

Implicits

Implicits

final implicit def SchemaOps[A](self: Schema[A]): SchemaOps[A]

Enriches Schema[A] with OpenAPI-specific operations.

Enriches Schema[A] with OpenAPI-specific operations.

Attributes

Source
package.scala