@@ -151,9 +151,9 @@ operationExample = mempty
151151 ]
152152
153153 stringSchema :: ParamLocation -> ParamOtherSchema
154− stringSchema i = mempty
155− & paramOtherSchemaIn .~ i
156− & schemaType .~ SwaggerString
154+ stringSchema loc = mempty
155+ & in_ .~ loc
156+ & type_ .~ SwaggerString
157157
158158operationExampleJSON :: Value
159159operationExampleJSON = [aesonQQ|
@@ -219,8 +219,8 @@ operationExampleJSON = [aesonQQ|
219219
220220schemaPrimitiveExample :: Schema
221221schemaPrimitiveExample = mempty
222− & schemaType .~ SwaggerString
223− & schemaFormat ?~ "email"
222+ & type_ .~ SwaggerString
223+ & format ?~ "email"
224224
225225schemaPrimitiveExampleJSON :: Value
226226schemaPrimitiveExampleJSON = [aesonQQ|
@@ -232,15 +232,15 @@ schemaPrimitiveExampleJSON = [aesonQQ|
232232
233233schemaSimpleModelExample :: Schema
234234schemaSimpleModelExample = mempty
235− & schemaType .~ SwaggerObject
236− & schemaRequired .~ [ "name" ]
237− & schemaProperties .~
238− [ ("name", Inline (mempty & schemaType .~ SwaggerString))
235+ & type_ .~ SwaggerObject
236+ & required .~ [ "name" ]
237+ & properties .~
238+ [ ("name", Inline (mempty & type_ .~ SwaggerString))
239239 , ("address", Ref (Reference "Address"))
240240 , ("age", Inline $ mempty
241− & schemaMinimum ?~ 0
242− & schemaType .~ SwaggerInteger
243− & schemaFormat ?~ "int32" ) ]
241+ & minimum_ ?~ 0
242+ & type_ .~ SwaggerInteger
243+ & format ?~ "int32" ) ]
244244
245245schemaSimpleModelExampleJSON :: Value
246246schemaSimpleModelExampleJSON = [aesonQQ|
@@ -267,8 +267,8 @@ schemaSimpleModelExampleJSON = [aesonQQ|
267267
268268schemaModelDictExample :: Schema
269269schemaModelDictExample = mempty
270− & schemaType .~ SwaggerObject
271− & schemaAdditionalProperties ?~ (mempty & schemaType .~ SwaggerString)
270+ & type_ .~ SwaggerObject
271+ & additionalProperties ?~ (mempty & type_ .~ SwaggerString)
272272
273273schemaModelDictExampleJSON :: Value
274274schemaModelDictExampleJSON = [aesonQQ|
@@ -281,12 +281,12 @@ schemaModelDictExampleJSON = [aesonQQ|
281281|]
282282
283283schemaWithExampleExample :: Schema
284−schemaWithExampleExample = (mempty & schemaType .~ SwaggerObject)
284+schemaWithExampleExample = (mempty & type_ .~ SwaggerObject)
285285 { _schemaProperties =
286286 [ ("id", Inline $ mempty
287− & schemaType .~ SwaggerInteger
288− & schemaFormat ?~ "int64" )
289− , ("name", Inline (mempty & schemaType .~ SwaggerString)) ]
287+ & type_ .~ SwaggerInteger
288+ & format ?~ "int64" )
289+ , ("name", Inline (mempty & type_ .~ SwaggerString)) ]
290290 , _schemaRequired = [ "name" ]
291291 , _schemaExample = Just [aesonQQ|
292292 {
@@ -325,19 +325,19 @@ schemaWithExampleExampleJSON = [aesonQQ|
325325definitionsExample :: HashMap Text Schema
326326definitionsExample =
327327 [ ("Category", mempty
328− & schemaType .~ SwaggerObject
329− & schemaProperties .~
328+ & type_ .~ SwaggerObject
329+ & properties .~
330330 [ ("id", Inline $ mempty
331− & schemaType .~ SwaggerInteger
332− & schemaFormat ?~ "int64")
333− , ("name", Inline (mempty & schemaType .~ SwaggerString)) ] )
331+ & type_ .~ SwaggerInteger
332+ & format ?~ "int64")
333+ , ("name", Inline (mempty & type_ .~ SwaggerString)) ] )
334334 , ("Tag", mempty
335− & schemaType .~ SwaggerObject
336− & schemaProperties .~
335+ & type_ .~ SwaggerObject
336+ & properties .~
337337 [ ("id", Inline $ mempty
338− & schemaType .~ SwaggerInteger
339− & schemaFormat ?~ "int64")
340− , ("name", Inline (mempty & schemaType .~ SwaggerString)) ] ) ]
338+ & type_ .~ SwaggerInteger
339+ & format ?~ "int64")
340+ , ("name", Inline (mempty & type_ .~ SwaggerString)) ] ) ]
341341
342342definitionsExampleJSON :: Value
343343definitionsExampleJSON = [aesonQQ|
@@ -380,17 +380,17 @@ paramsDefinitionExample =
380380 , _paramDescription = Just "number of items to skip"
381381 , _paramRequired = Just True
382382 , _paramSchema = ParamOther $ mempty
383− & paramOtherSchemaIn .~ ParamQuery
384− & schemaType .~ SwaggerInteger
385− & schemaFormat ?~ "int32" })
383+ & in_ .~ ParamQuery
384+ & type_ .~ SwaggerInteger
385+ & format ?~ "int32" })
386386 , ("limitParam", mempty
387387 { _paramName = "limit"
388388 , _paramDescription = Just "max records to return"
389389 , _paramRequired = Just True
390390 , _paramSchema = ParamOther $ mempty
391− & paramOtherSchemaIn .~ ParamQuery
392− & schemaType .~ SwaggerInteger
393− & schemaFormat ?~ "int32" }) ]
391+ & in_ .~ ParamQuery
392+ & type_ .~ SwaggerInteger
393+ & format ?~ "int32" }) ]
394394
395395paramsDefinitionExampleJSON :: Value
396396paramsDefinitionExampleJSON = [aesonQQ|
@@ -478,45 +478,44 @@ securityDefinitionsExampleJSON = [aesonQQ|
478478
479479swaggerExample :: Swagger
480480swaggerExample = mempty
481− { _basePath = Just "/"
482− , _schemes = Just [Http]
483− , _info = mempty
481+ { _swaggerBasePath = Just "/"
482+ , _swaggerSchemes = Just [Http]
483+ , _swaggerInfo = mempty
484484 { _infoVersion = "1.0"
485485 , _infoTitle = "Todo API"
486486 , _infoLicense = Just License
487487 { _licenseName = "MIT"
488488 , _licenseUrl = Just (URL "http://mit.com") }
489489 , _infoDescription = Just "This is a an API that tests servant-swagger support for a Todo API" }
490− , _paths = mempty
491− { _pathsMap =
492− [ ("/todo/{id}", mempty
493− { _pathItemGet = Just mempty
494− { _operationResponses = mempty
495− { _responsesResponses =
496− [ (200, Inline mempty
497− { _responseSchema = Just $ Inline (mempty & schemaType .~ SwaggerObject)
498− { _schemaExample = Just [aesonQQ|
499− {
500− "created": 100,
501− "description": "get milk"
502− } |]
503− , _schemaDescription = Just "This is some real Todo right here"
504− , _schemaProperties =
505− [ ("created", Inline $ mempty
506− & schemaType .~ SwaggerInteger
507− & schemaFormat ?~ "int32")
508− , ("description", Inline (mempty & schemaType .~ SwaggerString)) ] }
509− , _responseDescription = "OK" }) ] }
510− , _operationProduces = Just (MimeList [ "application/json" ])
511− , _operationParameters =
512− [ Inline mempty
513− { _paramRequired = Just True
514− , _paramName = "id"
515− , _paramDescription = Just "TodoId param"
516− , _paramSchema = ParamOther $ mempty
517− & paramOtherSchemaIn .~ ParamPath
518− & schemaType .~ SwaggerString } ]
519− , _operationTags = [ "todo" ] } }) ] } }
490+ , _swaggerPaths =
491+ [ ("/todo/{id}", mempty
492+ { _pathItemGet = Just mempty
493+ { _operationResponses = mempty
494+ { _responsesResponses =
495+ [ (200, Inline mempty
496+ { _responseSchema = Just $ Inline (mempty & type_ .~ SwaggerObject)
497+ { _schemaExample = Just [aesonQQ|
498+ {
499+ "created": 100,
500+ "description": "get milk"
501+ } |]
502+ , _schemaDescription = Just "This is some real Todo right here"
503+ , _schemaProperties =
504+ [ ("created", Inline $ mempty
505+ & type_ .~ SwaggerInteger
506+ & format ?~ "int32")
507+ , ("description", Inline (mempty & type_ .~ SwaggerString)) ] }
508+ , _responseDescription = "OK" }) ] }
509+ , _operationProduces = Just (MimeList [ "application/json" ])
510+ , _operationParameters =
511+ [ Inline mempty
512+ { _paramRequired = Just True
513+ , _paramName = "id"
514+ , _paramDescription = Just "TodoId param"
515+ , _paramSchema = ParamOther $ mempty
516+ & in_ .~ ParamPath
517+ & type_ .~ SwaggerString } ]
518+ , _operationTags = [ "todo" ] } }) ] }
520519
521520swaggerExampleJSON :: Value
522521swaggerExampleJSON = [aesonQQ|