aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/G4fClient/Model.hs15
-rw-r--r--tests/Instances.hs3
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/G4fClient/Model.hs b/lib/G4fClient/Model.hs
index 70cc4c5..35baa85 100644
--- a/lib/G4fClient/Model.hs
+++ b/lib/G4fClient/Model.hs
@@ -106,6 +106,21 @@ newtype XUser = XUser { unXUser :: Text } deriving (P.Eq, P.Show)
-- * Models
+-- ** AnyType
+newtype AnyType = AnyType A.Value
+ deriving (P.Eq, P.Show)
+
+instance A.FromJSON AnyType where
+ parseJSON v = pure (AnyType v)
+
+instance A.ToJSON AnyType where
+ toJSON (AnyType v) = v
+
+instance WH.ToHttpApiData AnyType where
+ toUrlPiece _ = ""
+ toQueryParam _ = ""
+ toHeader _ = ""
+
-- ** ApiKey
-- | ApiKey
-- Api Key
diff --git a/tests/Instances.hs b/tests/Instances.hs
index 33459bc..c7a3624 100644
--- a/tests/Instances.hs
+++ b/tests/Instances.hs
@@ -113,6 +113,9 @@ arbitraryReducedMaybeValue n = do
-- * Models
+instance Arbitrary AnyType where
+ arbitrary = AnyType <$> arbitrary
+
instance Arbitrary ApiKey where
arbitrary = sized genApiKey