HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleopenapi3-3.2.4Haskell2010

Data.OpenApi

Swagger™ is a project used to describe and document RESTful APIs.

The Swagger specification defines a set of files required to describe such an API. These files can then be used by the Swagger-UI project to display the API and Swagger-Codegen to generate clients in various languages. Additional utilities can also take advantage of the resulting files, such as testing tools.

  • 56 types
  • Packageopenapi3-3.2.4
  • Exports56
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceOpenApi.hs

How to use this library

0 declarations

This section explains how to use this library to work with Swagger specification.

Monoid instances

Virtually all types representing Swagger specification have Monoid instances. The Monoid type class provides two methods — mempty and mappend.

In this library you can use mempty for a default/empty value. For instance:

Example1 expression
BSL.putStrLn $ encodePretty (mempty :: OpenApi){    "components": {},    "info": {        "title": "",        "version": ""    },    "openapi": "3.0.0",    "paths": {}}

As you can see some spec properties (e.g. "version") are there even when the spec is empty. That is because these properties are actually required ones.

You should always override the default (empty) value for these properties, although it is not strictly necessary:

Example1 expression
BSL.putStrLn $ encodePretty mempty { _infoTitle = "Todo API", _infoVersion = "1.0" }{    "title": "Todo API",    "version": "1.0"}

You can merge two values using mappend or its infix version (<>):

Example1 expression
BSL.putStrLn $ encodePretty $ mempty { _infoTitle = "Todo API" } <> mempty { _infoVersion = "1.0" }{    "title": "Todo API",    "version": "1.0"}

Lenses and prisms

Note: if you're working with the optics library, take a look at Data.OpenApi.Optics.

Since Swagger has a fairly complex structure, lenses and prisms are used to work comfortably with it. In combination with Monoid instances, lenses make it fairly simple to construct/modify any part of the specification:

Example1 expression
:{BSL.putStrLn $ encodePretty $ (mempty :: OpenApi)  & components . schemas .~ IOHM.fromList [ ("User", mempty & type_ ?~ OpenApiString) ]  & paths .~    IOHM.fromList [ ("/user", mempty & get ?~ (mempty        & at 200 ?~ ("OK" & _Inline.content.at "application/json" ?~ (mempty & schema ?~ Ref (Reference "User")))        & at 404 ?~ "User info not found")) ]:}{    "components": {        "schemas": {            "User": {                "type": "string"            }        }    },    "info": {        "title": "",        "version": ""    },    "openapi": "3.0.0",    "paths": {        "/user": {            "get": {                "responses": {                    "200": {                        "content": {                            "application/json": {                                "schema": {                                    "$ref": "#/components/schemas/User"                                }                            }                        },                        "description": "OK"                    },                    "404": {                        "description": "User info not found"                    }                }            }        }    }}

In the snippet above we declare an API with a single path /user. This path provides method GET which produces application/json output. It should respond with code 200 and body specified by schema User which is defined in definitions property of swagger specification. Alternatively it may respond with code 404 meaning that user info is not found.

For convenience, swagger2 uses classy field lenses. It means that field accessor names can be overloaded for different types. One such common field is description. Many components of a Swagger specification can have descriptions, and you can use the same name for them:

Example2 expressions
BSL.putStrLn $ encodePretty $ (mempty :: Response) & description .~ "No content"{    "description": "No content"}:{BSL.putStrLn $ encodePretty $ (mempty :: Schema)  & type_       ?~ OpenApiBoolean  & description ?~ "To be or not to be":}{    "description": "To be or not to be",    "type": "boolean"}

Additionally, to simplify working with Response, both Operation and Responses have direct access to it via at code. Example:

Example1 expression
:{BSL.putStrLn $ encodePretty $ (mempty :: Operation)  & at 404 ?~ "Not found":}{    "responses": {        "404": {            "description": "Not found"        }    }}

You might've noticed that type_ has an extra underscore in its name compared to, say, description field accessor. This is because type is a keyword in Haskell. A few other field accessors are modified in this way:

Schema specification

ParamSchema and Schema are the two core types for data model specification.

ParamSchema t specifies all the common properties, available for every data schema. The t parameter imposes some restrictions on type and items properties (see OpenApiType and OpenApiItems).

Schema is used for request and response bodies and allows specifying objects with properties in addition to what ParamSchema provides.

In most cases you will have a Haskell data type for which you would like to define a corresponding schema. To facilitate this use case swagger2 provides two classes for schema encoding. Both these classes provide means to encode types as Swagger schemas.

ToParamSchema is intended to be used for primitive API endpoint parameters, such as query parameters, headers and URL path pieces. Its corresponding value-encoding class is ToHttpApiData (from http-api-data package).

ToSchema is used for request and response bodies and mostly differ from primitive parameters by allowing objects/mappings in addition to primitive types and arrays. Its corresponding value-encoding class is ToJSON (from aeson package).

While lenses and prisms make it easy to define schemas, it might be that you don't need to: ToSchema and ToParamSchema classes both have default Generic-based implementations!

ToSchema default implementation is also aligned with ToJSON default implementation with the only difference being for sum encoding. ToJSON defaults sum encoding to defaultTaggedObject, while ToSchema defaults to something which corresponds to ObjectWithSingleField. This is due to defaultTaggedObject behavior being hard to specify in Swagger.

Here's an example showing ToJSON–ToSchema correspondance:

Example5 expressions
data Person = Person { name :: String, age :: Integer } deriving Genericinstance ToJSON Personinstance ToSchema PersonBSL.putStrLn $ encodePretty (Person "David" 28){    "age": 28,    "name": "David"}BSL.putStrLn $ encodePretty $ toSchema (Proxy :: Proxy Person){    "properties": {        "age": {            "type": "integer"        },        "name": {            "type": "string"        }    },    "required": [        "name",        "age"    ],    "type": "object"}

This package implements OpenAPI 3.0 spec, which supports oneOf in schemas, allowing any sum types to be faithfully represented. All sum encodings supported by aeson are supported here as well, with an exception of Data.Aeson.TwoElemArray, since OpenAPI spec does not support heterogeneous arrays.

An example with Data.Aeson.TaggedObject encoding:

Example4 expressions
data Error = ErrorNoUser { userId :: Int } | ErrorAccessDenied { requiredPermission :: String } deriving Genericinstance ToJSON Errorinstance ToSchema ErrorBSL.putStrLn $ encodePretty $ toSchema (Proxy :: Proxy Error){    "oneOf": [        {            "properties": {                "tag": {                    "enum": [                        "ErrorNoUser"                    ],                    "type": "string"                },                "userId": {                    "maximum": 9223372036854775807,                    "minimum": -9223372036854775808,                    "type": "integer"                }            },            "required": [                "userId",                "tag"            ],            "title": "ErrorNoUser",            "type": "object"        },        {            "properties": {                "requiredPermission": {                    "type": "string"                },                "tag": {                    "enum": [                        "ErrorAccessDenied"                    ],                    "type": "string"                }            },            "required": [                "requiredPermission",                "tag"            ],            "title": "ErrorAccessDenied",            "type": "object"        }    ]}

Manipulation

Sometimes you have to work with an imported or generated Swagger. For instance, http://hackage.haskell.org/package/servant-swagger generates basic Swagger for a type-level servant API.

Lenses and prisms can be used to manipulate such specification to add additional information, tags, extra responses, etc. To facilitate common needs, Data.OpenApi.Operation module provides useful helpers.

Validation

While ToParamSchema and ToSchema provide means to easily obtain schemas for Haskell types, there is no static mechanism to ensure those instances correspond to the ToHttpApiData or ToJSON instances.

Data.OpenApi.Schema.Validation addresses ToJSON/ToSchema validation.

Re-exports

0 declarations

Swagger specification

4 declarations
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 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, …

Info types

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, …

PathItem

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, …

Operations

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 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, …

Types and formats

datadata OpenApiType where
#
Instances11Eq, Data, Show, Generic, FromJSON, ToJSON, …
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, …

Parameters

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 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 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 Example
#

Constructors

Instances26Eq, Data, Show, Generic, HasDatatypeInfo, HasSwaggerAesonOptions, …
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 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, …

Schemas

datadata Schema
#

Constructors

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

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

Instances26Eq, Data, Show, Generic, HasSchema, LabelOptic, …
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 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 AdditionalProperties
#
Instances6Eq, Data, Show, FromJSON, ToJSON, HasAdditionalProperties
datadata Discriminator
#

Constructors

Instances12Eq, Data, Show, Generic, FromJSON, ToJSON, …

Responses

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, …

Security

datadata SecurityScheme
#

Constructors

Instances17Eq, Data, Show, Semigroup, FromJSON, ToJSON, …
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 HttpSchemeType
#
Instances5Eq, Data, Show, Generic, Rep
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, …

API key

datadata ApiKeyParams
#

Constructors

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

The location of the API key.

Instances7Eq, Data, Show, Generic, FromJSON, ToJSON, …

OAuth2

datadata OAuth2Flows
#

Constructors

Instances22Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata OAuth2Flow p
#

Constructors

Instances18HasAuthorizationCode, HasClientCredentials, HasImplicit, HasPassword, Eq, Data, …
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, …
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.

External documentation

datadata ExternalDocs
#

Allows referencing an external resource for extended documentation.

Constructors

Instances20Eq, Data, Ord, Show, Generic, Semigroup, …

References

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, …

Miscellaneous

newtypenewtype MimeList
#
Instances9Eq, Data, Show, Semigroup, Monoid, FromJSON, …
newtypenewtype URL
#

Constructors

Instances12Eq, Data, Ord, Show, Hashable, FromJSON, …