forked from loafle/openapi-generator-original
[haskell-http-client] relax Aeson constraint to allow Aeson 1 (#12486)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user