@@ -38,18 +38,18 @@ data Swagger = Swagger
38 , swaggerPaths :: SwaggerPaths
38 , swaggerPaths :: SwaggerPaths
40 -- | An object to hold data types produced and consumed by operations.
40 -- | An object to hold data types produced and consumed by operations.
41− , swaggerDefinitions :: [SwaggerDefinition]
41+ , swaggerDefinitions :: HashMap Text SwaggerSchema
43 -- | An object to hold parameters that can be used across operations.
43 -- | An object to hold parameters that can be used across operations.
44 -- This property does not define global parameters for all operations.
44 -- This property does not define global parameters for all operations.
45− , swaggerParameters :: [SwaggerParamDefinition]
45+ , swaggerParameters :: HashMap Text SwaggerParameter
47 -- | An object to hold responses that can be used across operations.
47 -- | An object to hold responses that can be used across operations.
48 -- This property does not define global responses for all operations.
48 -- This property does not define global responses for all operations.
49− , swaggerResponses :: [SwaggerResponseDefinition]
49+ , swaggerResponses :: HashMap Text SwaggerResponse
51 -- | Security scheme definitions that can be used across the specification.
51 -- | Security scheme definitions that can be used across the specification.
52− , swaggerSecurityDefinitions :: [SwaggerSecurityDefinition]
52+ , swaggerSecurityDefinitions :: HashMap Text SwaggerSecurityScheme
54 -- | A declaration of which security schemes are applied for the API as a whole.
54 -- | A declaration of which security schemes are applied for the API as a whole.
55 -- The list of values describes alternative security schemes that can be used
55 -- The list of values describes alternative security schemes that can be used
@@ -559,18 +559,55 @@ data SwaggerHeader = SwaggerHeader
559data SwaggerExample = SwaggerExample
559data SwaggerExample = SwaggerExample
560 deriving (Show)
560 deriving (Show)
562−data SwaggerDefinition = SwaggerDefinition
562+-- | The location of the API key.
563+data SwaggerApiKeyLocation
564+ = SwaggerApiKeyQuery
565+ | SwaggerApiKeyHeader
563 deriving (Show)
566 deriving (Show)
565−data SwaggerParamDefinition = SwaggerParamDefinition
568+data SwaggerApiKeyParams = SwaggerApiKeyParams
569+ { -- | The name of the header or query parameter to be used.
570+ swaggerApiKeyName :: Text
572+ -- | The location of the API key.
573+ , swaggerApiKeyIn :: SwaggerApiKeyLocation
566− deriving (Show)
574+ } deriving (Show)
568−data SwaggerResponseDefinition = SwaggerResponseDefinition
576+-- | The authorization URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.
577+type AuthorizationURL = Text
579+-- | The token URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.
582+data SwaggerOAuth2Flow
583+ = SwaggerOAuth2Implicit AuthorizationURL
584+ | SwaggerOAuth2Password TokenURL
585+ | SwaggerOAuth2Application TokenURL
586+ | SwaggerOAuth2AccessCode AuthorizationURL TokenURL
569 deriving (Show)
587 deriving (Show)
571−data SwaggerSecurityDefinition = SwaggerSecurityDefinition
589+data SwaggerOAuth2Params = SwaggerOAuth2Params
590+ { -- | The flow used by the OAuth2 security scheme.
591+ swaggerOAuth2Flow :: SwaggerOAuth2Flow
593+ -- | The available scopes for the OAuth2 security scheme.
594+ , swaggerOAuth2Scopes :: HashMap Text Text
597+data SwaggerSecuritySchemeType
598+ = SwaggerSecuritySchemeBasic
599+ | SwaggerSecuritySchemeApiKey SwaggerApiKeyParams
600+ | SwaggerSecuritySchemeOAuth2 SwaggerOAuth2Params
572 deriving (Show)
601 deriving (Show)
603+data SwaggerSecurityScheme = SwaggerSecurityScheme
604+ { -- | The type of the security scheme.
605+ swaggerSecuritySchemeType :: SwaggerSecuritySchemeType
607+ -- | A short description for security scheme.
608+ , swaggerSecuritySchemeDescription :: Maybe Text
574data SwaggerSecurityRequirement = SwaggerSecurityRequirement
611data SwaggerSecurityRequirement = SwaggerSecurityRequirement
575 deriving (Show)
612 deriving (Show)