[haskell-http-client] relax Aeson constraint to allow Aeson 1 (#12486)

This commit is contained in:
Jon Schoning
2022-05-27 23:22:09 -05:00
committed by GitHub
parent e823290c8f
commit 078232acb5
12 changed files with 585 additions and 562 deletions

View File

@@ -23,6 +23,7 @@ Module : OpenAPIPetstore.Core
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
module OpenAPIPetstore.Core where
@@ -428,7 +429,11 @@ _applyAuthMethods req config@(OpenAPIPetstoreConfig {configAuthMethods = as}) =
-- * Utils
-- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)
#if MIN_VERSION_aeson(2,0,0)
_omitNulls :: [(A.Key, A.Value)] -> A.Value
#else
_omitNulls :: [(Text, A.Value)] -> A.Value
#endif
_omitNulls = A.object . P.filter notNull
where
notNull (_, A.Null) = False