git.iko.soy/typeable/openapi3
on master help sign in
Fix documentation for ToSchema (fix #60)
474a68bNickolay Kudasov
src/Data/Swagger/Internal/Schema.hs+9−9
@@ -88,15 +88,15 @@ rename name (NamedSchema _ schema) = NamedSchema name schema
88-- data Coord = Coord { x :: Double, y :: Double }
88-- data Coord = Coord { x :: Double, y :: Double }
89--
89--
90-- instance ToSchema Coord where
90-- instance ToSchema Coord where
91−-- declareNamedSchema = pure (Just \"Coord\", schema)
91+-- declareNamedSchema = do
92−-- where
92+-- doubleSchema <- declareSchemaRef (Proxy :: Proxy Double)
93−-- schema = mempty
93+-- return $ NamedSchema (Just \"Coord\")) $ mempty
94−-- & type_ .~ SwaggerObject
94+-- & type_ .~ SwaggerObject
95−-- & properties .~
95+-- & properties .~
96−-- [ (\"x\", toSchemaRef (Proxy :: Proxy Double))
96+-- [ (\"x\", doubleSchema)
97−-- , (\"y\", toSchemaRef (Proxy :: Proxy Double))
97+-- , (\"y\", doubleSchema)
98−-- ]
98+-- ]
99−-- & required .~ [ \"x\", \"y\" ]
99+-- & required .~ [ \"x\", \"y\" ]
100-- @
100-- @
101--
101--
102-- Instead of manually writing your @'ToSchema'@ instance you can
102-- Instead of manually writing your @'ToSchema'@ instance you can