@@ -51,6 +51,7 @@ spec = do
5151 describe "Definitions Object" $ definitionsExample <~> definitionsExampleJSON
5252 describe "Parameters Definition Object" $ parametersDefinitionExample <~> parametersDefinitionExampleJSON
5353 describe "Responses Definition Object" $ responsesDefinitionExample <~> responsesDefinitionExampleJSON
54+ describe "Security Definitions Object" $ securityDefinitionsExample <~> securityDefinitionsExampleJSON
5455
5556main :: IO ()
5657main = hspec spec
@@ -458,3 +459,40 @@ responsesDefinitionExampleJSON = [aesonQQ|
458459 }
459460}
460461|]
462+
463+-- =======================================================================
464+-- Responses Definition object
465+-- =======================================================================
466+
467+securityDefinitionsExample :: HashMap Text SwaggerSecurityScheme
468+securityDefinitionsExample =
469+ [ ("api_key", SwaggerSecurityScheme
470+ { swaggerSecuritySchemeType = SwaggerSecuritySchemeApiKey (SwaggerApiKeyParams "api_key" SwaggerApiKeyHeader)
471+ , swaggerSecuritySchemeDescription = Nothing })
472+ , ("petstore_auth", SwaggerSecurityScheme
473+ { swaggerSecuritySchemeType = SwaggerSecuritySchemeOAuth2 (SwaggerOAuth2Params
474+ { swaggerOAuth2Flow = SwaggerOAuth2Implicit "http://swagger.io/api/oauth/dialog"
475+ , swaggerOAuth2Scopes =
476+ [ ("write:pets", "modify pets in your account")
477+ , ("read:pets", "read your pets") ] } )
478+ , swaggerSecuritySchemeDescription = Nothing }) ]
479+
480+securityDefinitionsExampleJSON :: Value
481+securityDefinitionsExampleJSON = [aesonQQ|
482+{
483+ "api_key": {
484+ "type": "apiKey",
485+ "name": "api_key",
486+ "in": "header"
487+ },
488+ "petstore_auth": {
489+ "type": "oauth2",
490+ "authorizationUrl": "http://swagger.io/api/oauth/dialog",
491+ "flow": "implicit",
492+ "scopes": {
493+ "write:pets": "modify pets in your account",
494+ "read:pets": "read your pets"
495+ }
496+ }
497+}
498+|]