Maintainer | Nickolay Kudasov <nickolay@getshoptv.com> |
---|---|
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
Synopsis
- module Data.OpenApi.Lens
- module Data.OpenApi.Operation
- module Data.OpenApi.ParamSchema
- module Data.OpenApi.Schema
- module Data.OpenApi.Schema.Validation
- data OpenApi = OpenApi {}
- data Server = Server {}
- data ServerVariable = ServerVariable {}
- data Components = Components {
- _componentsSchemas :: Definitions Schema
- _componentsResponses :: Definitions Response
- _componentsParameters :: Definitions Param
- _componentsExamples :: Definitions Example
- _componentsRequestBodies :: Definitions RequestBody
- _componentsHeaders :: Definitions Header
- _componentsSecuritySchemes :: SecurityDefinitions
- _componentsLinks :: Definitions Link
- _componentsCallbacks :: Definitions Callback
- data Info = Info {}
- data Contact = Contact {}
- data License = License {
- _licenseName :: Text
- _licenseUrl :: Maybe URL
- data PathItem = PathItem {
- _pathItemSummary :: Maybe Text
- _pathItemDescription :: Maybe Text
- _pathItemGet :: Maybe Operation
- _pathItemPut :: Maybe Operation
- _pathItemPost :: Maybe Operation
- _pathItemDelete :: Maybe Operation
- _pathItemOptions :: Maybe Operation
- _pathItemHead :: Maybe Operation
- _pathItemPatch :: Maybe Operation
- _pathItemTrace :: Maybe Operation
- _pathItemServers :: [Server]
- _pathItemParameters :: [Referenced Param]
- data Operation = Operation {
- _operationTags :: InsOrdHashSet TagName
- _operationSummary :: Maybe Text
- _operationDescription :: Maybe Text
- _operationExternalDocs :: Maybe ExternalDocs
- _operationOperationId :: Maybe Text
- _operationParameters :: [Referenced Param]
- _operationRequestBody :: Maybe (Referenced RequestBody)
- _operationResponses :: Responses
- _operationCallbacks :: InsOrdHashMap Text (Referenced Callback)
- _operationDeprecated :: Maybe Bool
- _operationSecurity :: [SecurityRequirement]
- _operationServers :: [Server]
- data Tag = Tag {}
- type TagName = Text
- data OpenApiType where
- type Format = Text
- type Definitions = InsOrdHashMap Text
- data Style
- data Param = Param {
- _paramName :: Text
- _paramDescription :: Maybe Text
- _paramRequired :: Maybe Bool
- _paramDeprecated :: Maybe Bool
- _paramIn :: ParamLocation
- _paramAllowEmptyValue :: Maybe Bool
- _paramAllowReserved :: Maybe Bool
- _paramSchema :: Maybe (Referenced Schema)
- _paramStyle :: Maybe Style
- _paramExplode :: Maybe Bool
- _paramExample :: Maybe Value
- _paramExamples :: InsOrdHashMap Text (Referenced Example)
- data ParamLocation
- type ParamName = Text
- data Header = Header {}
- type HeaderName = Text
- data Example = Example {}
- data RequestBody = RequestBody {}
- data MediaTypeObject = MediaTypeObject {}
- data Encoding = Encoding {}
- data Schema = Schema {
- _schemaTitle :: Maybe Text
- _schemaDescription :: Maybe Text
- _schemaRequired :: [ParamName]
- _schemaNullable :: Maybe Bool
- _schemaAllOf :: Maybe [Referenced Schema]
- _schemaOneOf :: Maybe [Referenced Schema]
- _schemaNot :: Maybe (Referenced Schema)
- _schemaAnyOf :: Maybe [Referenced Schema]
- _schemaProperties :: InsOrdHashMap Text (Referenced Schema)
- _schemaAdditionalProperties :: Maybe AdditionalProperties
- _schemaDiscriminator :: Maybe Discriminator
- _schemaReadOnly :: Maybe Bool
- _schemaWriteOnly :: Maybe Bool
- _schemaXml :: Maybe Xml
- _schemaExternalDocs :: Maybe ExternalDocs
- _schemaExample :: Maybe Value
- _schemaDeprecated :: Maybe Bool
- _schemaMaxProperties :: Maybe Integer
- _schemaMinProperties :: Maybe Integer
- _schemaDefault :: Maybe Value
- _schemaType :: Maybe OpenApiType
- _schemaFormat :: Maybe Format
- _schemaItems :: Maybe OpenApiItems
- _schemaMaximum :: Maybe Scientific
- _schemaExclusiveMaximum :: Maybe Bool
- _schemaMinimum :: Maybe Scientific
- _schemaExclusiveMinimum :: Maybe Bool
- _schemaMaxLength :: Maybe Integer
- _schemaMinLength :: Maybe Integer
- _schemaPattern :: Maybe Pattern
- _schemaMaxItems :: Maybe Integer
- _schemaMinItems :: Maybe Integer
- _schemaUniqueItems :: Maybe Bool
- _schemaEnum :: Maybe [Value]
- _schemaMultipleOf :: Maybe Scientific
- data NamedSchema = NamedSchema {}
- data OpenApiItems where
- data Xml = Xml {
- _xmlName :: Maybe Text
- _xmlNamespace :: Maybe Text
- _xmlPrefix :: Maybe Text
- _xmlAttribute :: Maybe Bool
- _xmlWrapped :: Maybe Bool
- type Pattern = Text
- data AdditionalProperties
- data Discriminator = Discriminator {}
- data Responses = Responses {}
- data Response = Response {}
- type HttpStatusCode = Int
- data Link = Link {}
- newtype Callback = Callback (InsOrdHashMap Text PathItem)
- data SecurityScheme = SecurityScheme {}
- data SecuritySchemeType
- data HttpSchemeType
- newtype SecurityDefinitions = SecurityDefinitions (Definitions SecurityScheme)
- newtype SecurityRequirement = SecurityRequirement {}
- data ApiKeyParams = ApiKeyParams {}
- data ApiKeyLocation
- data OAuth2Flows = OAuth2Flows {}
- data OAuth2Flow p = OAuth2Flow {}
- newtype OAuth2ImplicitFlow = OAuth2ImplicitFlow {}
- newtype OAuth2PasswordFlow = OAuth2PasswordFlow {}
- newtype OAuth2ClientCredentialsFlow = OAuth2ClientCredentialsFlow {}
- data OAuth2AuthorizationCodeFlow = OAuth2AuthorizationCodeFlow {}
- type AuthorizationURL = Text
- type TokenURL = Text
- data ExternalDocs = ExternalDocs {}
- newtype Reference = Reference {
- getReference :: Text
- data Referenced a
- newtype MimeList = MimeList {
- getMimeList :: [MediaType]
- newtype URL = URL {}
How to use this library
This section explains how to use this library to work with Swagger specification.
Monoid
instances
Monoid
Virtually all types representing Swagger specification have
instances.
The Monoid
type class provides two methods — Monoid
and mempty
.mappend
In this library you can use
for a default/empty value. For instance:mempty
>>>
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:
>>>
BSL.putStrLn $ encodePretty mempty { _infoTitle = "Todo API", _infoVersion = "1.0" }
{ "title": "Todo API", "version": "1.0" }
You can merge two values using
or its infix version mappend
(
:<>
)
>>>
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
has a fairly complex structure, lenses and prisms are used
to work comfortably with it. In combination with Swagger
instances, lenses
make it fairly simple to construct/modify any part of the specification:Monoid
>>>
:{
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
property of swagger specification.
Alternatively it may respond with code definitions
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
. Many components of a Swagger specification
can have descriptions, and you can use the same name for them:description
>>>
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
, both Response
and Operation
have direct access to it via Responses
. Example:at
code
>>>
:{
BSL.putStrLn $ encodePretty $ (mempty :: Operation) & at 404 ?~ "Not found" :} { "responses": { "404": { "description": "Not found" } } }
You might've noticed that
has an extra underscore in its name
compared to, say, type_
field accessor.
This is because description
type
is a keyword in Haskell.
A few other field accessors are modified in this way:
Schema specification
and ParamSchema
are the two core types for data model specification.Schema
specifies all the common properties, available for every data schema.
The ParamSchema
tt
parameter imposes some restrictions on type
and items
properties (see
and OpenApiType
).OpenApiItems
is used for request and response bodies and allows specifying objects
with properties in addition to what Schema
provides.ParamSchema
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.
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 ToParamSchema
(from ToHttpApiData
http-api-data
package).
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 ToSchema
(from ToJSON
aeson
package).
While lenses and prisms make it easy to define schemas, it might be that you don't need to:
and ToSchema
classes both have default ToParamSchema
-based implementations!Generic
default implementation is also aligned with ToSchema
default implementation with
the only difference being for sum encoding. ToJSON
defaults sum encoding to ToJSON
,
while defaultTaggedObject
defaults to something which corresponds to ToSchema
. This is due to
ObjectWithSingleField
behavior being hard to specify in Swagger.defaultTaggedObject
Here's an example showing
–ToJSON
correspondance:ToSchema
>>>
data Person = Person { name :: String, age :: Integer } deriving Generic
>>>
instance ToJSON Person
>>>
instance ToSchema Person
>>>
BSL.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 TwoElemArray
, since OpenAPI spec does not support heterogeneous arrays.
An example with TaggedObject
encoding:
>>>
data Error = ErrorNoUser { userId :: Int } | ErrorAccessDenied { requiredPermission :: String } deriving Generic
>>>
instance ToJSON Error
>>>
instance ToSchema Error
>>>
BSL.putStrLn $ encodePretty $ toSchema (Proxy :: Proxy Error)
{ "oneOf": [ { "properties": { "tag": { "enum": [ "ErrorNoUser" ], "type": "string" }, "userId": { "maximum": 9223372036854775807, "minimum": -9223372036854775808, "type": "integer" } }, "required": [ "userId", "tag" ], "type": "object" }, { "properties": { "requiredPermission": { "type": "string" }, "tag": { "enum": [ "ErrorAccessDenied" ], "type": "string" } }, "required": [ "requiredPermission", "tag" ], "type": "object" } ] }
Manipulation
Sometimes you have to work with an imported or generated
.
For instance, http://hackage.haskell.org/package/servant-swagger generates basic Swagger
for a type-level servant API.Swagger
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
and ToParamSchema
provide means to easily obtain schemas for Haskell types,
there is no static mechanism to ensure those instances correspond to the ToSchema
or ToHttpApiData
instances.ToJSON
Data.OpenApi.Schema.Validation
addresses
/ToJSON
validation.ToSchema
Re-exports
module Data.OpenApi.Lens
module Data.OpenApi.Operation
module Data.OpenApi.ParamSchema
module Data.OpenApi.Schema
Swagger specification
This is the root document object for the API specification.
OpenApi | |
|
Instances
An object representing a Server.
Server | |
|
Instances
data ServerVariable Source #
ServerVariable | |
|
Instances
data Components Source #
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.
Instances
Info types
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.
Info | |
|
Instances
Contact information for the exposed API.
Contact | |
|
Instances
License information for the exposed API.
License | |
|
Instances
FromJSON License Source # | |
ToJSON License Source # | |
Defined in Data.OpenApi.Internal | |
Data License Source # | |
Defined in Data.OpenApi.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> License -> c License # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c License # toConstr :: License -> Constr # dataTypeOf :: License -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c License) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c License) # gmapT :: (forall b. Data b => b -> b) -> License -> License # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> License -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> License -> r # gmapQ :: (forall d. Data d => d -> u) -> License -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> License -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> License -> m License # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> License -> m License # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> License -> m License # | |
IsString License Source # | |
Defined in Data.OpenApi.Internal fromString :: String -> License # | |
Generic License Source # | |
Show License Source # | |
Eq License Source # | |
HasName License Text Source # | |
(k ~ A_Lens, a ~ Text, b ~ Text) => LabelOptic "name" k License License a b Source # | |
Defined in Data.OpenApi.Optics | |
(k ~ A_Lens, a ~ Maybe URL, b ~ Maybe URL) => LabelOptic "url" k License License a b Source # | |
Defined in Data.OpenApi.Optics | |
HasLicense Info (Maybe License) Source # | |
HasUrl License (Maybe URL) Source # | |
type Rep License Source # | |
Defined in Data.OpenApi.Internal type Rep License = D1 ('MetaData "License" "Data.OpenApi.Internal" "openapi3-3.2.3-1GDWKFdjVUVI26l6xU7yLu" 'False) (C1 ('MetaCons "License" 'PrefixI 'True) (S1 ('MetaSel ('Just "_licenseName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_licenseUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URL)))) |
PathItem
Describes the operations available on a single path.
A
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.PathItem
PathItem | |
|
Instances
Operations
Describes a single API operation on a path.
Operation | |
|
Instances
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.
Tag | |
|
Instances
Types and formats
data OpenApiType where Source #
Instances
type Definitions = InsOrdHashMap Text Source #
A list of definitions that can be used in references.
In order to support common ways of serializing simple parameters, a set of style values are defined.
StyleMatrix | Path-style parameters defined by RFC6570. |
StyleLabel | Label style parameters defined by RFC6570. |
StyleForm | Form style parameters defined by RFC6570.
This option replaces |
StyleSimple | Simple style parameters defined by RFC6570.
This option replaces |
StyleSpaceDelimited | Space separated array values.
This option replaces |
StylePipeDelimited | Pipe separated array values.
This option replaces |
StyleDeepObject | Provides a simple way of rendering nested objects using form parameters. |
Instances
FromJSON Style Source # | |
ToJSON Style Source # | |
Defined in Data.OpenApi.Internal | |
Data Style Source # | |
Defined in Data.OpenApi.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Style -> c Style # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Style # dataTypeOf :: Style -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Style) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Style) # gmapT :: (forall b. Data b => b -> b) -> Style -> Style # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r # gmapQ :: (forall d. Data d => d -> u) -> Style -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Style -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Style -> m Style # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style # | |
Generic Style Source # | |
Show Style Source # | |
Eq Style Source # | |
HasStyle Encoding (Maybe Style) Source # | |
HasStyle Param (Maybe Style) Source # | |
type Rep Style Source # | |
Defined in Data.OpenApi.Internal type Rep Style = D1 ('MetaData "Style" "Data.OpenApi.Internal" "openapi3-3.2.3-1GDWKFdjVUVI26l6xU7yLu" 'False) ((C1 ('MetaCons "StyleMatrix" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "StyleLabel" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StyleForm" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "StyleSimple" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StyleSpaceDelimited" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "StylePipeDelimited" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StyleDeepObject" 'PrefixI 'False) (U1 :: Type -> Type)))) |
Parameters
Describes a single operation parameter. A unique parameter is defined by a combination of a name and location.
Param | |
|
Instances
data ParamLocation Source #
ParamQuery | Parameters that are appended to the URL.
For example, in |
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 |
ParamCookie | Used to pass a specific cookie value to the API. |
Instances
Header fields have the same meaning as for Param
.
Style is always treated as StyleSimple
, as it is the only value allowed for headers.
Header | |
|
Instances
type HeaderName = Text Source #
Example | |
|
Instances
data RequestBody Source #
Describes a single request body.
RequestBody | |
|
Instances
data MediaTypeObject Source #
Each Media Type Object provides schema and examples for the media type identified by its key.
MediaTypeObject | |
|
Instances
Encoding | |
|
Instances
Schemas
Instances
data NamedSchema Source #
A
with an optional name.
This name can be used in references.Schema
Instances
data OpenApiItems where Source #
Items for
schemas.OpenApiArray
Warning: OpenAPI 3.0 does not support tuple arrays. However, OpenAPI 3.1 will, as it will incorporate Json Schema mostly verbatim.
should be used to specify homogenous array OpenApiItemsObject
s.Schema
should be used to specify tuple OpenApiItemsArray
s.Schema
OpenApiItemsObject :: Referenced Schema -> OpenApiItems | |
OpenApiItemsArray :: [Referenced Schema] -> OpenApiItems |
Instances
Xml | |
|
Instances
data AdditionalProperties Source #
Instances
data Discriminator Source #
Discriminator | |
|
Instances
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.
Responses | |
|
Instances
Describes a single response from an API Operation.
Response | |
|
Instances
type HttpStatusCode = Int Source #
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.
Link | |
|
Instances
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.
Instances
Security
data SecurityScheme Source #
SecurityScheme | |
|
Instances
data SecuritySchemeType Source #
>>>
BSL.putStrLn $ encodePretty (SecuritySchemeHttp (HttpSchemeBearer Nothing))
{ "scheme": "bearer", "type": "http" }
>>>
BSL.putStrLn $ encodePretty (SecuritySchemeHttp (HttpSchemeBearer (Just "jwt")))
{ "bearerFormat": "jwt", "scheme": "bearer", "type": "http" }
>>>
BSL.putStrLn $ encodePretty (SecuritySchemeHttp HttpSchemeBasic)
{ "scheme": "basic", "type": "http" }
>>>
BSL.putStrLn $ encodePretty (SecuritySchemeHttp (HttpSchemeCustom "CANARY"))
{ "scheme": "CANARY", "type": "http" }
>>>
BSL.putStrLn $ encodePretty (SecuritySchemeApiKey (ApiKeyParams "id" ApiKeyCookie))
{ "in": "cookie", "name": "id", "type": "apiKey" }
SecuritySchemeHttp HttpSchemeType | |
SecuritySchemeApiKey ApiKeyParams | |
SecuritySchemeOAuth2 OAuth2Flows | |
SecuritySchemeOpenIdConnect URL |
Instances
data HttpSchemeType Source #
Instances
newtype SecurityDefinitions Source #
Instances
newtype SecurityRequirement Source #
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).
Instances
API key
data ApiKeyParams Source #
ApiKeyParams | |
|
Instances
data ApiKeyLocation Source #
The location of the API key.
Instances
OAuth2
data OAuth2Flows Source #
OAuth2Flows | |
|
Instances
data OAuth2Flow p Source #
OAuth2Flow | |
|
Instances
newtype OAuth2ImplicitFlow Source #
Instances
newtype OAuth2PasswordFlow Source #
Instances
newtype OAuth2ClientCredentialsFlow Source #
Instances
data OAuth2AuthorizationCodeFlow Source #
Instances
type AuthorizationURL = Text Source #
The authorization URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.
The token URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.
External documentation
data ExternalDocs Source #
Allows referencing an external resource for extended documentation.
ExternalDocs | |
|
Instances
References
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.
Instances
FromJSON Reference Source # | |
ToJSON Reference Source # | |
Defined in Data.OpenApi.Internal | |
Data Reference Source # | |
Defined in Data.OpenApi.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Reference -> c Reference # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Reference # toConstr :: Reference -> Constr # dataTypeOf :: Reference -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Reference) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Reference) # gmapT :: (forall b. Data b => b -> b) -> Reference -> Reference # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Reference -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Reference -> r # gmapQ :: (forall d. Data d => d -> u) -> Reference -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Reference -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Reference -> m Reference # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Reference -> m Reference # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Reference -> m Reference # | |
Show Reference Source # | |
Eq Reference Source # | |
data Referenced a Source #
Instances
Miscellaneous
MimeList | |
|
Instances
FromJSON MimeList Source # | |
ToJSON MimeList Source # | |
Defined in Data.OpenApi.Internal | |
Data MimeList Source # | |
Defined in Data.OpenApi.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MimeList -> c MimeList # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MimeList # toConstr :: MimeList -> Constr # dataTypeOf :: MimeList -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MimeList) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MimeList) # gmapT :: (forall b. Data b => b -> b) -> MimeList -> MimeList # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MimeList -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MimeList -> r # gmapQ :: (forall d. Data d => d -> u) -> MimeList -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MimeList -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MimeList -> m MimeList # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MimeList -> m MimeList # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MimeList -> m MimeList # | |
Monoid MimeList Source # | |
Semigroup MimeList Source # | |
Show MimeList Source # | |
Eq MimeList Source # | |
AesonDefaultValue MimeList Source # | |
Defined in Data.OpenApi.Internal | |
SwaggerMonoid MimeList Source # | |
Defined in Data.OpenApi.Internal |
Instances
FromJSON URL Source # | |
ToJSON URL Source # | |
Defined in Data.OpenApi.Internal | |
Data URL Source # | |
Defined in Data.OpenApi.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URL -> c URL # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URL # dataTypeOf :: URL -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URL) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URL) # gmapT :: (forall b. Data b => b -> b) -> URL -> URL # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r # gmapQ :: (forall d. Data d => d -> u) -> URL -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> URL -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> URL -> m URL # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URL -> m URL # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URL -> m URL # | |
Show URL Source # | |
Eq URL Source # | |
Ord URL Source # | |
Hashable URL Source # | |
Defined in Data.OpenApi.Internal | |
SwaggerMonoid URL Source # | |
Defined in Data.OpenApi.Internal swaggerMempty :: URL Source # | |
HasUrl ExternalDocs URL Source # | |
Defined in Data.OpenApi.Lens | |
HasExternalValue Example (Maybe URL) Source # | |
Defined in Data.OpenApi.Lens | |
HasUrl Contact (Maybe URL) Source # | |
HasUrl License (Maybe URL) Source # | |