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

Moduleswagger2-2.8.9Haskell2010

Data.Swagger.Internal

  • 48 types
  • 22 values
  • Packageswagger2-2.8.9
  • Exports71
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs
Example2 expressions
:seti -XDataKindsimport Data.Aeson
datadata Swagger
#

This is the root document object for the API specification.

Constructors

  • Swagger
    • _swaggerInfo :: Info

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

    • _swaggerHost :: Maybe Host

      The host (name or ip) serving the API. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port).

    • _swaggerBasePath :: Maybe FilePath

      The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/).

    • _swaggerSchemes :: Maybe [Scheme]

      The transfer protocol of the API. If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.

    • _swaggerConsumes :: MimeList

      A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls.

    • _swaggerProduces :: MimeList

      A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls.

    • _swaggerPaths :: InsOrdHashMap FilePath PathItem

      The available paths and operations for the API. Holds the relative paths to the individual endpoints. The path is appended to the basePath in order to construct the full URL.

    • _swaggerDefinitions :: Definitions Schema

      An object to hold data types produced and consumed by operations.

    • _swaggerParameters :: Definitions Param

      An object to hold parameters that can be used across operations. This property does not define global parameters for all operations.

    • _swaggerResponses :: Definitions Response

      An object to hold responses that can be used across operations. This property does not define global responses for all operations.

    • _swaggerSecurityDefinitions :: SecurityDefinitions

      Security scheme definitions that can be used across the specification.

    • _swaggerSecurity :: [SecurityRequirement]

      A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.

    • _swaggerTags :: 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.

    • _swaggerExternalDocs :: Maybe ExternalDocs

      Additional external documentation.

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

The object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the Swagger-UI 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 Host
#

The host (name or ip) serving the API. It MAY include a port.

Constructors

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

The transfer protocol of the API.

Instances9Eq, Data, Show, Generic, FromJSON, ToJSON, …
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

Instances33Eq, 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. GFM 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. Tools and libraries MAY use the it to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.

    • _operationConsumes :: Maybe MimeList

      A list of MIME types the operation can consume. This overrides the consumes. Just [] MAY be used to clear the global definition.

    • _operationProduces :: Maybe MimeList

      A list of MIME types the operation can produce. This overrides the produces. Just [] MAY be used to clear the global definition.

    • _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.

    • _operationResponses :: Responses

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

    • _operationSchemes :: Maybe [Scheme]

      The transfer protocol for the operation. The value overrides schemes.

    • _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.

    • _operationExtensions :: InsOrdHashMap Text Value

      Extensions to the Swagger schema's operations. These automatically get the x- prefix required by the swagger specification.

Instances57Eq, Data, Show, Semigroup, Monoid, FromJSON, …
newtypenewtype MimeList
#
Instances13Eq, 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. GFM syntax can 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.

    • _paramSchema :: ParamAnySchema

      Parameter schema.

Instances28Eq, Data, Show, Semigroup, Monoid, Generic, …
datadata ParamAnySchema
#
Instances12Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata ParamOtherSchema
#

Constructors

Instances39Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata SwaggerItems (t :: SwaggerKind Type) where
#

Items for SwaggerArray schemas.

SwaggerItemsPrimitive should be used only for query params, headers and path pieces. The CollectionFormat t parameter specifies how elements of an array should be displayed. Note that fmt in SwaggerItemsPrimitive fmt schema specifies format for elements of type schema. This is different from the original Swagger's Items Object.

SwaggerItemsObject should be used to specify homogenous array Schemas.

SwaggerItemsArray should be used to specify tuple Schemas.

Instances14LabelOptic, Eq, Data, Show, FromJSON, ToJSON, …
datadata SwaggerType (t :: SwaggerKind Type) where
#
Instances16Eq, Data, Show, FromJSON, ToJSON, AesonDefaultValue, …
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.

  • ParamFormData

    Used to describe the payload of an HTTP request when either application/x-www-form-urlencoded or multipart/form-data are used as the content type of the request (in Swagger's definition, the consumes property of an operation). This is the only parameter type that can be used to send files, thus supporting the ParamFile type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4).

Instances10Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata CollectionFormat (t :: SwaggerKind Type) where
#
Instances7Eq, Data, Show, FromJSON, ToJSON, …
datadata Schema
#
Instances66Eq, Data, Show, Semigroup, Monoid, Generic, …
datadata NamedSchema
#

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

Instances28Eq, Data, Show, Generic, HasSchema, LabelOptic, …
datadata ParamSchema (t :: SwaggerKind Type)
#

Constructors

Instances56LabelOptic, HasParamSchema, Eq, Data, Show, Semigroup, …
datadata Xml
#

Constructors

  • Xml
    • _xmlName :: Maybe Text

      Replaces the name of the element/attribute used for the described schema property. When defined within the SwaggerItems (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, …
datadata Header
#

Constructors

Instances37Eq, Data, Show, Semigroup, Monoid, FromJSON, …
datadata Example
#
Instances10Eq, Data, Show, Generic, Semigroup, Monoid, …
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.

datadata OAuth2Flow
#
Instances8Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata OAuth2Params
#

Constructors

Instances12Eq, Data, Show, FromJSON, ToJSON, Generic, …
datadata SecuritySchemeType
#
Instances12Eq, Data, Show, Generic, FromJSON, ToJSON, …
datadata SecurityScheme
#

Constructors

Instances17Eq, Data, Show, Semigroup, FromJSON, ToJSON, …
newtypenewtype SecurityDefinitions
#
Instances16Eq, 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

Instances21Functor, LabelOptic, HasAllOf, HasDefault, HasParameters, HasSchema, …
newtypenewtype URL
#

Constructors

Instances11Eq, Data, Ord, Show, Hashable, FromJSON, …
  • Eq URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • Data URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • Ord URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • Show URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • Hashable URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • FromJSON URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • ToJSON URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • SwaggerMonoid URLDefined in swagger2-2.8.9 · Data.Swagger.Internal
  • HasUrl ExternalDocs URLDefined in swagger2-2.8.9 · Data.Swagger.Lens
  • HasUrl Contact (Maybe URL)Defined in swagger2-2.8.9 · Data.Swagger.Lens
  • HasUrl License (Maybe URL)Defined in swagger2-2.8.9 · Data.Swagger.Lens
datadata AdditionalProperties
#
Instances6Eq, Data, Show, FromJSON, ToJSON, HasAdditionalProperties

Orphan instances

1 instance