Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Data/OpenApi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module Data.OpenApi (
-- ** Miscellaneous
MimeList(..),
URL(..),
SpecificationExtensions(..),
) where

import Data.OpenApi.Lens
Expand Down Expand Up @@ -187,7 +188,6 @@ import Data.OpenApi.Internal
-- "title": "Todo API",
-- "version": "1.0"
-- }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the catch!

--
-- This can be useful for combining specifications of endpoints into a whole API specification:
--
Expand Down Expand Up @@ -416,7 +416,6 @@ import Data.OpenApi.Internal
-- }
-- ]
-- }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this empty line is crucial, it separates a new section "manipulation" from the previous one. please bring it back :)

-- $manipulation
-- Sometimes you have to work with an imported or generated @'Swagger'@.
-- For instance, <servant-swagger http://hackage.haskell.org/package/servant-swagger> generates basic @'Swagger'@
Expand Down
7 changes: 7 additions & 0 deletions src/Data/OpenApi/Aeson/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ lookupKey = KeyMap.lookup . Key.fromText

hasKey :: T.Text -> KeyMap.KeyMap a -> Bool
hasKey = KeyMap.member . Key.fromText

filterWithKey :: (Key -> v -> Bool) -> KeyMap.KeyMap v -> KeyMap.KeyMap v
filterWithKey = KeyMap.filterWithKey

#else
deleteKey :: T.Text -> HM.HashMap T.Text v -> HM.HashMap T.Text v
deleteKey = HM.delete
Expand Down Expand Up @@ -73,4 +77,7 @@ lookupKey = HM.lookup

hasKey :: T.Text -> HM.HashMap T.Text a -> Bool
hasKey = HM.member

filterWithKey :: (T.Text -> v -> Bool) -> HM.HashMap T.Text v -> HM.HashMap T.Text v
filterWithKey = HM.filterWithKey
#endif
Loading