HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleopenapi3-3.2.4Haskell2010

Data.OpenApi.Internal

  • 59 types
  • 8 values
  • Packageopenapi3-3.2.4
  • Exports67
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs
Example4 expressions
:seti -XDataKindsimport Data.Aesonimport Data.ByteString.Lazy.Char8 as BSLimport Data.OpenApi.Internal.Utils
datadata OpenApi
#

This is the root document object for the API specification.

Constructors

  • OpenApi
    • _openApiInfo :: Info

      Provides metadata about the API. The metadata can be used by the clients if needed.

    • _openApiServers :: [Server]

      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 /.

    • _openApiPaths :: InsOrdHashMap FilePath PathItem

      The available paths and operations for the API.

    • _openApiComponents :: Components

      An element to hold various schemas for the specification.

    • _openApiSecurity :: [SecurityRequirement]

      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. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement can be included in the array.

    • _openApiTags :: InsOrdHashSet Tag

      A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.

    • _openApiExternalDocs :: Maybe ExternalDocs

      Additional external documentation.

    • _openApiOpenapi :: OpenApiSpecVersion

      The spec of OpenApi this spec adheres to. Must be between lowerOpenApiSpecVersion and upperOpenApiSpecVersion

Instances30Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata Info
#

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.

Constructors

Instances24Eq, Data, Show, Generic, Semigroup, Monoid, …
datadata Contact
#

Contact information for the exposed API.

Constructors

Instances16Eq, Data, Show, Generic, Semigroup, Monoid, …
datadata License
#

License information for the exposed API.

Constructors

Instances13Eq, Data, Show, IsString, Generic, FromJSON, …
datadata Server
#

An object representing a Server.

Constructors

  • Server
    • _serverUrl :: Text

      A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in {brackets}.

    • _serverDescription :: Maybe Text

      An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.

    • _serverVariables :: InsOrdHashMap Text ServerVariable

      A map between a variable name and its value. The value is used for substitution in the server's URL template.

Instances24Eq, Data, Show, IsString, FromJSON, ToJSON, …
datadata ServerVariable
#

Constructors

Instances11Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata Components
#

Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

Instances35Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata PathItem
#

Describes the operations available on a single path. A PathItem may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.

Constructors

Instances41Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata Operation
#

Describes a single API operation on a path.

Constructors

  • Operation
    • _operationTags :: InsOrdHashSet TagName

      A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.

    • _operationSummary :: Maybe Text

      A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.

    • _operationDescription :: Maybe Text

      A verbose explanation of the operation behavior. CommonMark syntax can be used for rich text representation.

    • _operationExternalDocs :: Maybe ExternalDocs

      Additional external documentation for this operation.

    • _operationOperationId :: Maybe Text

      Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.

    • _operationParameters :: [Referenced Param]

      A list of parameters that are applicable for this operation. If a parameter is already defined at the PathItem, the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location.

    • _operationRequestBody :: Maybe (Referenced RequestBody)

      The request body applicable for this operation. The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.

    • _operationResponses :: Responses

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

    • _operationCallbacks :: InsOrdHashMap Text (Referenced Callback)

      A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses.

    • _operationDeprecated :: Maybe Bool

      Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is False.

    • _operationSecurity :: [SecurityRequirement]

      A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level security. To remove a top-level security declaration, Just [] can be used.

    • _operationServers :: [Server]

      An alternative server array to service this operation. If an alternative server object is specified at the PathItem Object or Root level, it will be overridden by this value.

Instances56Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata RequestBody
#

Describes a single request body.

Constructors

Instances24Eq, Data, Show, Semigroup, Monoid, Generic, …
datadata MediaTypeObject
#

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

Constructors

Instances24Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata Style
#

In order to support common ways of serializing simple parameters, a set of style values are defined.

Constructors

  • StyleMatrix

    Path-style parameters defined by RFC6570.

  • StyleLabel

    Label style parameters defined by RFC6570.

  • StyleForm

    Form style parameters defined by RFC6570. This option replaces collectionFormat with a csv (when explode is false) or multi (when explode is true) value from OpenAPI 2.0.

  • StyleSimple

    Simple style parameters defined by RFC6570. This option replaces collectionFormat with a csv value from OpenAPI 2.0.

  • StyleSpaceDelimited

    Space separated array values. This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

  • StylePipeDelimited

    Pipe separated array values. This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

  • StyleDeepObject

    Provides a simple way of rendering nested objects using form parameters.

Instances9Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata Encoding
#

Constructors

  • Encoding
    • _encodingContentType :: Maybe MediaType

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

    • _encodingHeaders :: InsOrdHashMap Text (Referenced Header)

      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.

    • _encodingStyle :: Maybe Style

      Describes how a specific property value will be serialized depending on its type. See Param 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.

    • _encodingExplode :: Maybe Bool

      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.

    • _encodingAllowReserved :: Maybe Bool

      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@.

Instances25Eq, Data, Show, Semigroup, Monoid, FromJSON, …
newtypenewtype MimeList
#
Instances9Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata Param
#

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

Constructors

  • Param
    • _paramName :: Text

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

    • _paramDescription :: Maybe Text

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

    • _paramRequired :: Maybe Bool

      Determines whether this parameter is mandatory. If the parameter is in "path", this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is False.

    • _paramDeprecated :: Maybe Bool

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

    • _paramIn :: ParamLocation

      The location of the parameter.

    • _paramAllowEmptyValue :: Maybe Bool

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

    • _paramAllowReserved :: Maybe Bool

      Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 :/?#[]!$&'()*+,;=@ to be included without percent-encoding. This property only applies to parameters with an _paramIn value of ParamQuery. The default value is False.

    • _paramSchema :: Maybe (Referenced Schema)

      Parameter schema.

    • _paramStyle :: Maybe Style

      Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of _paramIn): for ParamQuery - StyleForm; for ParamPath - StyleSimple; for ParamHeader - StyleSimple; for ParamCookie - StyleForm.

    • _paramExplode :: Maybe Bool

      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. For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false.

    • _paramExample :: Maybe Value

      Example of the parameter's potential value. The example SHOULD match the specified schema and encoding properties if present. The _paramExample field is mutually exclusive of the _paramExamples field. Furthermore, if referencing a schema that contains an example, the example value SHALL override the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

    • _paramExamples :: InsOrdHashMap Text (Referenced Example)

      Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The _paramExamples field is mutually exclusive of the _paramExample field. Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.

Instances44Eq, Data, Show, Semigroup, Monoid, Generic, …
datadata Example
#

Constructors

Instances26Eq, Data, Show, Generic, HasDatatypeInfo, HasSwaggerAesonOptions, …
datadata ExpressionOrValue
#
Instances9Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata OpenApiItems where
#

Items for OpenApiArray schemas.

Warning: OpenAPI 3.0 does not support tuple arrays. However, OpenAPI 3.1 will, as it will incorporate Json Schema mostly verbatim.

OpenApiItemsObject should be used to specify homogenous array Schemas.

OpenApiItemsArray should be used to specify tuple Schemas.

Instances9Eq, Data, Show, FromJSON, ToJSON, LabelOptic, …
datadata OpenApiType where
#
Instances11Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata ParamLocation
#

Constructors

  • ParamQuery

    Parameters that are appended to the URL. For example, in /items?id=###, the query parameter is id.

  • ParamHeader

    Custom headers that are expected as part of the request.

  • ParamPath

    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.

  • ParamCookie

    Used to pass a specific cookie value to the API.

Instances10Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata Schema
#

Constructors

Instances92Eq, Data, Show, Semigroup, Monoid, Generic, …
datadata Discriminator
#

Constructors

Instances12Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata NamedSchema
#

A Schema with an optional name. This name can be used in references.

Instances26Eq, Data, Show, Generic, HasSchema, LabelOptic, …
datadata Xml
#

Constructors

  • Xml
    • _xmlName :: Maybe Text

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

    • _xmlNamespace :: Maybe Text

      The URL of the namespace definition. Value SHOULD be in the form of a URL.

    • _xmlPrefix :: Maybe Text

      The prefix to be used for the name.

    • _xmlAttribute :: Maybe Bool

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

    • _xmlWrapped :: Maybe Bool

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

Instances18Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata Responses
#

A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. It is not expected from the documentation to necessarily cover all possible HTTP response codes, since they may not be known in advance. However, it is expected from the documentation to cover a successful operation response and any known errors.

Constructors

Instances30Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata Response
#

Describes a single response from an API Operation.

Constructors

Instances29Eq, Data, Show, IsString, Semigroup, Monoid, …
newtypenewtype Callback
#

A map of possible out-of band callbacks related to the parent operation. Each value in the map is a PathItem 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.

Instances11Eq, Data, Show, Generic, HasCallbacks, FromJSON, …
datadata Header
#

Header fields have the same meaning as for Param.

Style is always treated as StyleSimple, as it is the only value allowed for headers.

Instances35Eq, Data, Show, Semigroup, Monoid, Generic, …
datadata ApiKeyLocation
#

The location of the API key.

Instances7Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata ApiKeyParams
#

Constructors

Instances7Eq, Data, Show, Generic, FromJSON, ToJSON, …
typetype AuthorizationURL = Text
#

The authorization URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.

typetype TokenURL = Text
#

The token URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.

newtypenewtype OAuth2ImplicitFlow
#
Instances11Eq, Data, Show, Generic, FromJSON, ToJSON, …
newtypenewtype OAuth2PasswordFlow
#
Instances11Eq, Data, Show, Generic, FromJSON, ToJSON, …
newtypenewtype OAuth2ClientCredentialsFlow
#
Instances11Eq, Data, Show, Generic, FromJSON, ToJSON, …
Instances13Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata OAuth2Flow p
#

Constructors

Instances18HasAuthorizationCode, HasClientCredentials, HasImplicit, HasPassword, Eq, Data, …
datadata OAuth2Flows
#

Constructors

Instances22Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata HttpSchemeType
#
Instances5Eq, Data, Show, Generic, Rep
datadata SecuritySchemeType
#
Example1 expression
BSL.putStrLn $ encodePretty (SecuritySchemeHttp (HttpSchemeBearer Nothing)){    "scheme": "bearer",    "type": "http"}
Example1 expression
BSL.putStrLn $ encodePretty (SecuritySchemeHttp (HttpSchemeBearer (Just "jwt"))){    "bearerFormat": "jwt",    "scheme": "bearer",    "type": "http"}
Example1 expression
BSL.putStrLn $ encodePretty (SecuritySchemeHttp HttpSchemeBasic){    "scheme": "basic",    "type": "http"}
Example1 expression
BSL.putStrLn $ encodePretty (SecuritySchemeHttp (HttpSchemeCustom "CANARY")){    "scheme": "CANARY",    "type": "http"}
Example1 expression
BSL.putStrLn $ encodePretty (SecuritySchemeApiKey (ApiKeyParams "id" ApiKeyCookie)){    "in": "cookie",    "name": "id",    "type": "apiKey"}
Instances13Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata SecurityScheme
#

Constructors

Instances17Eq, Data, Show, Semigroup, FromJSON, ToJSON, …
newtypenewtype SecurityDefinitions
#
Instances12Eq, Data, Show, Generic, Semigroup, Monoid, …
newtypenewtype SecurityRequirement
#

Lists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes).

Instances10Eq, Data, Read, Show, Semigroup, Monoid, …
datadata Tag
#

Allows adding meta data to a single tag that is used by Operation. It is not mandatory to have a Tag per tag used there.

Constructors

Instances17Eq, Data, Ord, Show, IsString, Generic, …
datadata ExternalDocs
#

Allows referencing an external resource for extended documentation.

Constructors

Instances20Eq, Data, Ord, Show, Generic, Semigroup, …
newtypenewtype Reference
#

A simple object to allow referencing other definitions in the specification. It can be used to reference parameters and responses that are defined at the top level for reuse.

Instances5Eq, Data, Show, FromJSON, ToJSON
datadata Referenced a
#

Constructors

Instances44Functor, LabelOptic, HasAllOf, HasAnyOf, HasDefault, HasNot, …
newtypenewtype URL
#

Constructors

Instances12Eq, Data, Ord, Show, Hashable, FromJSON, …
datadata AdditionalProperties
#
Instances6Eq, Data, Show, FromJSON, ToJSON, HasAdditionalProperties
newtypenewtype OpenApiSpecVersion
#
Instances17Eq, Data, Show, Semigroup, Monoid, FromJSON, …

Orphan instances

8 instances