Skip to content

Commit

Permalink
Add support for Specification Extensions
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Biehl <[email protected]>
Co-authored-by: Avery <[email protected]>
  • Loading branch information
3 people committed Apr 24, 2024
1 parent efb9a50 commit c1ac4fb
Show file tree
Hide file tree
Showing 7 changed files with 263 additions and 101 deletions.
1 change: 1 addition & 0 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
6 changes: 6 additions & 0 deletions src/Data/OpenApi/Aeson/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ deleteKey = KeyMap.delete
objectToList :: KeyMap.KeyMap v -> [(Key, v)]
objectToList = KeyMap.toList

objectFromList :: [(Key, v)] -> KeyMap.KeyMap v
objectFromList = KeyMap.fromList

objectKeys :: KeyMap.KeyMap v -> [T.Text]
objectKeys = map Key.toText . KeyMap.keys

Expand Down Expand Up @@ -50,6 +53,9 @@ deleteKey = HM.delete
objectToList :: HM.HashMap T.Text v -> [(T.Text, v)]
objectToList = HM.toList

objectFromList :: [(T.Text, v)] -> HM.HashMap T.Text v
objectFromList = HM.fromList

objectKeys :: HM.HashMap T.Text v -> [T.Text]
objectKeys = HM.keys

Expand Down
Loading

0 comments on commit c1ac4fb

Please sign in to comment.