Skip to content

Commit c1ac4fb

Browse files
isomorphemealexbiehlPPKFS
committed
Add support for Specification Extensions
Co-authored-by: Alex Biehl <[email protected]> Co-authored-by: Avery <[email protected]>
1 parent efb9a50 commit c1ac4fb

File tree

7 files changed

+263
-101
lines changed

7 files changed

+263
-101
lines changed

src/Data/OpenApi.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module Data.OpenApi (
119119
-- ** Miscellaneous
120120
MimeList(..),
121121
URL(..),
122+
SpecificationExtensions (..),
122123
) where
123124

124125
import Data.OpenApi.Lens

src/Data/OpenApi/Aeson/Compat.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ deleteKey = KeyMap.delete
2020
objectToList :: KeyMap.KeyMap v -> [(Key, v)]
2121
objectToList = KeyMap.toList
2222

23+
objectFromList :: [(Key, v)] -> KeyMap.KeyMap v
24+
objectFromList = KeyMap.fromList
25+
2326
objectKeys :: KeyMap.KeyMap v -> [T.Text]
2427
objectKeys = map Key.toText . KeyMap.keys
2528

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

56+
objectFromList :: [(T.Text, v)] -> HM.HashMap T.Text v
57+
objectFromList = HM.fromList
58+
5359
objectKeys :: HM.HashMap T.Text v -> [T.Text]
5460
objectKeys = HM.keys
5561

0 commit comments

Comments
 (0)