| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Swagger.Internal
- data Swagger = Swagger {
- _info :: Info
- _host :: Maybe Host
- _basePath :: Maybe FilePath
- _schemes :: Maybe [Scheme]
- _consumes :: MimeList
- _produces :: MimeList
- _paths :: Paths
- _definitions :: HashMap Text Schema
- _parameters :: HashMap Text Param
- _responses :: HashMap Text Response
- _securityDefinitions :: HashMap Text SecurityScheme
- _security :: [SecurityRequirement]
- _tags :: [Tag]
- _externalDocs :: Maybe ExternalDocs
- data Info = Info {}
- data Contact = Contact {}
- data License = License {
- _licenseName :: Text
- _licenseUrl :: Maybe URL
- data Host = Host {}
- hostConstr :: Constr
- hostDataType :: DataType
- data Scheme
- data Paths = Paths {}
- data PathItem = PathItem {}
- data Operation = Operation {
- _operationTags :: [TagName]
- _operationSummary :: Maybe Text
- _operationDescription :: Maybe Text
- _operationExternalDocs :: Maybe ExternalDocs
- _operationOperationId :: Maybe Text
- _operationConsumes :: Maybe MimeList
- _operationProduces :: Maybe MimeList
- _operationParameters :: [Referenced Param]
- _operationResponses :: Responses
- _operationSchemes :: Maybe [Scheme]
- _operationDeprecated :: Maybe Bool
- _operationSecurity :: [SecurityRequirement]
- newtype MimeList = MimeList {
- getMimeList :: [MediaType]
- mimeListConstr :: Constr
- mimeListDataType :: DataType
- data Param = Param {}
- data ParamAnySchema
- data ParamOtherSchema = ParamOtherSchema {}
- data SwaggerItems t where
- SwaggerItemsPrimitive :: Maybe (CollectionFormat t) -> ParamSchema t -> SwaggerItems t
- SwaggerItemsObject :: Referenced Schema -> SwaggerItems Schema
- SwaggerItemsArray :: [Referenced Schema] -> SwaggerItems Schema
- swaggerItemsPrimitiveConstr :: Constr
- swaggerItemsDataType :: DataType
- data SwaggerType t where
- swaggerTypeConstr :: Data (SwaggerType t) => SwaggerType t -> Constr
- swaggerTypeDataType :: Data (SwaggerType t) => SwaggerType t -> DataType
- swaggerCommonTypes :: [SwaggerType t]
- swaggerParamTypes :: [SwaggerType ParamOtherSchema]
- swaggerSchemaTypes :: [SwaggerType Schema]
- swaggerTypeConstrs :: [Constr]
- data ParamLocation
- type Format = Text
- data CollectionFormat t where
- collectionFormatConstr :: CollectionFormat t -> Constr
- collectionFormatDataType :: DataType
- collectionCommonFormats :: [CollectionFormat t]
- type ParamName = Text
- data Schema = Schema {
- _schemaTitle :: Maybe Text
- _schemaDescription :: Maybe Text
- _schemaRequired :: [ParamName]
- _schemaAllOf :: Maybe [Schema]
- _schemaProperties :: HashMap Text (Referenced Schema)
- _schemaAdditionalProperties :: Maybe Schema
- _schemaDiscriminator :: Maybe Text
- _schemaReadOnly :: Maybe Bool
- _schemaXml :: Maybe Xml
- _schemaExternalDocs :: Maybe ExternalDocs
- _schemaExample :: Maybe Value
- _schemaMaxProperties :: Maybe Integer
- _schemaMinProperties :: Maybe Integer
- _schemaParamSchema :: ParamSchema Schema
- data ParamSchema t = ParamSchema {
- _paramSchemaDefault :: Maybe Value
- _paramSchemaType :: SwaggerType t
- _paramSchemaFormat :: Maybe Format
- _paramSchemaItems :: Maybe (SwaggerItems t)
- _paramSchemaMaximum :: Maybe Scientific
- _paramSchemaExclusiveMaximum :: Maybe Bool
- _paramSchemaMinimum :: Maybe Scientific
- _paramSchemaExclusiveMinimum :: Maybe Bool
- _paramSchemaMaxLength :: Maybe Integer
- _paramSchemaMinLength :: Maybe Integer
- _paramSchemaPattern :: Maybe Text
- _paramSchemaMaxItems :: Maybe Integer
- _paramSchemaMinItems :: Maybe Integer
- _paramSchemaUniqueItems :: Maybe Bool
- _paramSchemaEnum :: Maybe [Value]
- _paramSchemaMultipleOf :: Maybe Scientific
- data Xml = Xml {
- _xmlName :: Maybe Text
- _xmlNamespace :: Maybe Text
- _xmlPrefix :: Maybe Text
- _xmlAttribute :: Maybe Bool
- _xmlWrapped :: Maybe Bool
- data Responses = Responses {}
- type HttpStatusCode = Int
- data Response = Response {}
- type HeaderName = Text
- data Header = Header {}
- data Example = Example {}
- exampleConstr :: Constr
- exampleDataType :: DataType
- data ApiKeyLocation
- data ApiKeyParams = ApiKeyParams {}
- type AuthorizationURL = Text
- type TokenURL = Text
- data OAuth2Flow
- data OAuth2Params = OAuth2Params {}
- data SecuritySchemeType
- data SecurityScheme = SecurityScheme {}
- newtype SecurityRequirement = SecurityRequirement {}
- type TagName = Text
- data Tag = Tag {}
- data ExternalDocs = ExternalDocs {}
- newtype Reference = Reference {
- getReference :: Text
- data Referenced a
- newtype URL = URL {}
- referencedToJSON :: ToJSON a => Text -> Referenced a -> Value
- referencedParseJSON :: FromJSON a => Text -> Value -> Parser (Referenced a)
Documentation
This is the root document object for the API specification.
Constructors
| Swagger | |
Fields
| |
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
| Info | |
Fields
| |
Contact information for the exposed API.
Constructors
| Contact | |
Fields
| |
License information for the exposed API.
Constructors
| License | |
Fields
| |
The host (name or ip) serving the API. It MAY include a port.
The transfer protocol of the API.
The available paths and operations for the API.
Constructors
| Paths | |
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
Constructors
| PathItem | |
Fields
| |
Describes a single API operation on a path.
Constructors
| Operation | |
Fields
| |
Constructors
| MimeList | |
Fields
| |
Describes a single operation parameter. A unique parameter is defined by a combination of a name and location.
Constructors
| Param | |
Fields
| |
Instances
data ParamAnySchema Source
Constructors
| ParamBody (Referenced Schema) | |
| ParamOther ParamOtherSchema |
data ParamOtherSchema Source
Constructors
| ParamOtherSchema | |
Fields
| |
Instances
data SwaggerItems t where Source
Items for schemas.SwaggerArray
should be used only for query params, headers and path pieces.
The SwaggerItemsPrimitive parameter specifies how elements of an array should be displayed.
Note that CollectionFormat tfmt in specifies format for elements of type SwaggerItemsPrimitive fmt schemaschema.
This is different from the original Swagger's Items Object.
should be used to specify homogenous array SwaggerItemsObjects.Schema
should be used to specify tuple SwaggerItemsArrays.Schema
Constructors
| SwaggerItemsPrimitive :: Maybe (CollectionFormat t) -> ParamSchema t -> SwaggerItems t | |
| SwaggerItemsObject :: Referenced Schema -> SwaggerItems Schema | |
| SwaggerItemsArray :: [Referenced Schema] -> SwaggerItems Schema |
Instances
| Eq (SwaggerItems t) Source | |
| Data t => Data (SwaggerItems t) Source | |
| Data (SwaggerItems Schema) Source | |
| Show (SwaggerItems t) Source | |
| ToJSON (SwaggerItems t) Source | |
| (FromJSON (CollectionFormat t), FromJSON (ParamSchema t)) => FromJSON (SwaggerItems t) Source | |
| FromJSON (SwaggerItems Schema) Source |
data SwaggerType t where Source
Constructors
Instances
| Eq (SwaggerType t) Source | |
| Typeable * t => Data (SwaggerType t) Source | |
| Data (SwaggerType Schema) Source | |
| Data (SwaggerType ParamOtherSchema) Source | |
| Show (SwaggerType t) Source | |
| ToJSON (SwaggerType t) Source | |
| FromJSON (SwaggerType t) Source | |
| FromJSON (SwaggerType Schema) Source | |
| FromJSON (SwaggerType ParamOtherSchema) Source | |
| SwaggerMonoid (SwaggerType t) Source |
swaggerTypeConstr :: Data (SwaggerType t) => SwaggerType t -> Constr Source
swaggerTypeDataType :: Data (SwaggerType t) => SwaggerType t -> DataType Source
swaggerCommonTypes :: [SwaggerType t] Source
data ParamLocation Source
Constructors
| 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 |
| ParamFormData | Used to describe the payload of an HTTP request when either |
data CollectionFormat t where Source
Determines the format of the array.
Constructors
| CollectionCSV :: CollectionFormat t | |
| CollectionSSV :: CollectionFormat t | |
| CollectionTSV :: CollectionFormat t | |
| CollectionPipes :: CollectionFormat t | |
| CollectionMulti :: CollectionFormat ParamOtherSchema |
Instances
Constructors
Instances
data ParamSchema t Source
Constructors
| ParamSchema | |
Fields
| |
Instances
| Eq (ParamSchema t) Source | |
| (Data t, Data (SwaggerType t), Data (SwaggerItems t)) => Data (ParamSchema t) Source | |
| Show (ParamSchema t) Source | |
| Generic (ParamSchema t) Source | |
| ToJSON (ParamSchema t) Source | |
| (FromJSON (SwaggerType t), FromJSON (SwaggerItems t)) => FromJSON (ParamSchema t) Source | |
| Monoid (ParamSchema t) Source | |
| SwaggerMonoid (ParamSchema t) Source | |
| HasParamSchema (ParamSchema t) t Source | |
| type Rep (ParamSchema t) Source |
Constructors
| Xml | |
Fields
| |
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
| Responses | |
Fields
| |
type HttpStatusCode = Int Source
Describes a single response from an API Operation.
Constructors
| Response | |
Fields
| |
Instances
type HeaderName = Text Source
Constructors
| Header | |
Fields
| |
Constructors
| Example | |
Fields | |
data ApiKeyParams Source
Constructors
| ApiKeyParams | |
Fields
| |
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.
data OAuth2Flow Source
data OAuth2Params Source
Constructors
| OAuth2Params | |
Fields
| |
data SecuritySchemeType Source
data SecurityScheme Source
Constructors
| SecurityScheme | |
Fields
| |
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).
Constructors
| SecurityRequirement | |
Fields | |
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
| Tag | |
Fields
| |
data ExternalDocs Source
Allows referencing an external resource for extended documentation.
Constructors
| ExternalDocs | |
Fields
| |
Instances
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.
Constructors
| Reference | |
Fields
| |
data Referenced a Source
Instances
| Eq a => Eq (Referenced a) Source | |
| Data a => Data (Referenced a) Source | |
| Show a => Show (Referenced a) Source | |
| ToJSON (Referenced Response) Source | |
| ToJSON (Referenced Schema) Source | |
| ToJSON (Referenced Param) Source | |
| FromJSON (Referenced Response) Source | |
| FromJSON (Referenced Schema) Source | |
| FromJSON (Referenced Param) Source | |
| Monoid a => SwaggerMonoid (Referenced a) Source |
referencedToJSON :: ToJSON a => Text -> Referenced a -> Value Source
referencedParseJSON :: FromJSON a => Text -> Value -> Parser (Referenced a) Source