git.iko.soy/typeable/openapi3
on master help sign in
Fix documentation for ToSchema (fix #60)
commit474a68be463eb52a320950ec0c661bf9bdd18180 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateMon 14 Mar 2016, 18:19 (11 years ago) parent6855545
1 file changed+9−9
src/Data/Swagger/Internal/Schema.hs+9−9
src/Data/Swagger/Internal/Schema.hs+9−9
@@ -88,15 +88,15 @@ rename name (NamedSchema _ schema) = NamedSchema name schema
8888-- data Coord = Coord { x :: Double, y :: Double }
8989--
9090-- instance ToSchema Coord where
91−-- declareNamedSchema = pure (Just \"Coord\", schema)
92−-- where
93−-- schema = mempty
94−-- & type_ .~ SwaggerObject
95−-- & properties .~
96−-- [ (\"x\", toSchemaRef (Proxy :: Proxy Double))
97−-- , (\"y\", toSchemaRef (Proxy :: Proxy Double))
98−-- ]
99−-- & required .~ [ \"x\", \"y\" ]
91+-- declareNamedSchema = do
92+-- doubleSchema <- declareSchemaRef (Proxy :: Proxy Double)
93+-- return $ NamedSchema (Just \"Coord\")) $ mempty
94+-- & type_ .~ SwaggerObject
95+-- & properties .~
96+-- [ (\"x\", doubleSchema)
97+-- , (\"y\", doubleSchema)
98+-- ]
99+-- & required .~ [ \"x\", \"y\" ]
100100-- @
101101--
102102-- Instead of manually writing your @'ToSchema'@ instance you can