File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/Servant/Swagger/Internal Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -139,11 +139,12 @@ props _ f px = sequence_ specs
139
139
-- (using 'encodePretty').
140
140
--
141
141
-- >>> import Data.Aeson
142
+ -- >>> import Data.Foldable (traverse_)
142
143
-- >>> data Person = Person { name :: String, phone :: Integer } deriving (Generic)
143
144
-- >>> instance ToJSON Person where toJSON p = object [ "name" .= name p ]
144
145
-- >>> instance ToSchema Person
145
146
-- >>> let person = Person { name = "John", phone = 123456 }
146
- -- >>> mapM_ putStrLn $ prettyValidateWith validateToJSON person
147
+ -- >>> traverse_ putStrLn $ prettyValidateWith validateToJSON person
147
148
-- Validation against the schema fails:
148
149
-- * property "phone" is required, but not found in "{\"name\":\"John\"}"
149
150
-- <BLANKLINE>
You can’t perform that action at this time.
0 commit comments