aeson-schemas 1.4.3.0 → 1.4.3.1
raw patch · 4 files changed
+22/−15 lines, 4 filesdep ~aesondep ~first-class-familiesdep ~hashablePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, first-class-families, hashable, megaparsec, template-haskell, text, unordered-containers
API changes (from Hackage documentation)
- Data.Aeson.Schema.Utils.All: instance forall k1 k2 (f :: k1 -> GHC.Types.Constraint). Data.Aeson.Schema.Utils.All.All f '[]
+ Data.Aeson.Schema.Internal: ($dmparseValue) :: (HasSchemaResult schema, FromJSON (SchemaResult schema)) => [Key] -> Value -> Parser (SchemaResult schema)
+ Data.Aeson.Schema.Internal: ($dmshowValue) :: (HasSchemaResult schema, Show (SchemaResult schema)) => SchemaResult schema -> ShowS
+ Data.Aeson.Schema.Internal: ($dmtoValue) :: (HasSchemaResult schema, ToJSON (SchemaResult schema)) => SchemaResult schema -> Value
+ Data.Aeson.Schema.Utils.All: instance forall k a (f :: k -> GHC.Types.Constraint). Data.Aeson.Schema.Utils.All.All f '[]
- Data.Aeson.Schema: toMap :: IsSchema ('Schema schema) => Object ('Schema schema) -> Object
+ Data.Aeson.Schema: toMap :: forall (schema :: SchemaObjectMap' Symbol Type). IsSchema ('Schema schema) => Object ('Schema schema) -> Object
- Data.Aeson.Schema: type IsSchema (schema :: Schema) = (HasSchemaResult (ToSchemaObject schema), All HasSchemaResultPair (FromSchema schema), IsSchemaObjectMap (FromSchema schema), SchemaResult (ToSchemaObject schema) ~ Object schema)
+ Data.Aeson.Schema: type IsSchema (schema :: Schema) = (HasSchemaResult ToSchemaObject schema, All HasSchemaResultPair FromSchema schema, IsSchemaObjectMap FromSchema schema, SchemaResult ToSchemaObject schema ~ Object schema)
- Data.Aeson.Schema.Internal: class (IsSchemaType schema) => HasSchemaResult (schema :: SchemaType)
+ Data.Aeson.Schema.Internal: class IsSchemaType schema => HasSchemaResult (schema :: SchemaType)
- Data.Aeson.Schema.Internal: class ParseSumType xs
+ Data.Aeson.Schema.Internal: class ParseSumType (xs :: [SchemaType])
- Data.Aeson.Schema.Internal: data UnSchemaKey :: SchemaKey -> Exp Symbol
+ Data.Aeson.Schema.Internal: data UnSchemaKey (a :: SchemaKey) (b :: Symbol)
- Data.Aeson.Schema.Internal: parseValue :: (HasSchemaResult schema, FromJSON (SchemaResult schema)) => [Key] -> Value -> Parser (SchemaResult schema)
+ Data.Aeson.Schema.Internal: parseValue :: HasSchemaResult schema => [Key] -> Value -> Parser (SchemaResult schema)
- Data.Aeson.Schema.Internal: showValue :: (HasSchemaResult schema, Show (SchemaResult schema)) => SchemaResult schema -> ShowS
+ Data.Aeson.Schema.Internal: showValue :: HasSchemaResult schema => SchemaResult schema -> ShowS
- Data.Aeson.Schema.Internal: showValuePair :: HasSchemaResultPair a => Proxy a -> Object schema -> (String, ShowS)
+ Data.Aeson.Schema.Internal: showValuePair :: forall (schema :: Schema). HasSchemaResultPair a => Proxy a -> Object schema -> (String, ShowS)
- Data.Aeson.Schema.Internal: toMap :: IsSchema ('Schema schema) => Object ('Schema schema) -> Object
+ Data.Aeson.Schema.Internal: toMap :: forall (schema :: SchemaObjectMap' Symbol Type). IsSchema ('Schema schema) => Object ('Schema schema) -> Object
- Data.Aeson.Schema.Internal: toValue :: (HasSchemaResult schema, ToJSON (SchemaResult schema)) => SchemaResult schema -> Value
+ Data.Aeson.Schema.Internal: toValue :: HasSchemaResult schema => SchemaResult schema -> Value
- Data.Aeson.Schema.Internal: toValueMap :: forall pairs. All HasSchemaResultPair pairs => Object ('Schema pairs) -> Object
+ Data.Aeson.Schema.Internal: toValueMap :: forall (pairs :: SchemaObjectMap' Symbol Type). All HasSchemaResultPair pairs => Object ('Schema pairs) -> Object
- Data.Aeson.Schema.Internal: toValuePair :: HasSchemaResultPair a => Proxy a -> Object schema -> Object
+ Data.Aeson.Schema.Internal: toValuePair :: forall (schema :: Schema). HasSchemaResultPair a => Proxy a -> Object schema -> Object
- Data.Aeson.Schema.Internal: type IsSchema (schema :: Schema) = (HasSchemaResult (ToSchemaObject schema), All HasSchemaResultPair (FromSchema schema), IsSchemaObjectMap (FromSchema schema), SchemaResult (ToSchemaObject schema) ~ Object schema)
+ Data.Aeson.Schema.Internal: type IsSchema (schema :: Schema) = (HasSchemaResult ToSchemaObject schema, All HasSchemaResultPair FromSchema schema, IsSchemaObjectMap FromSchema schema, SchemaResult ToSchemaObject schema ~ Object schema)
- Data.Aeson.Schema.Internal: type Lookup a = Map Snd <=< Find (TyEq a <=< Fst)
+ Data.Aeson.Schema.Internal: type Lookup (a2 :: a1) = Map Snd :: (a, b) -> b -> Type :: Maybe (a, b) -> Maybe b -> Type <=< Find TyEq a2 :: a -> Bool -> Type <=< Fst :: (a, b) -> a -> Type
- Data.Aeson.Schema.Key: class (KnownSymbol (FromSchemaKey key)) => IsSchemaKey (key :: SchemaKey) where {
+ Data.Aeson.Schema.Key: class KnownSymbol FromSchemaKey key => IsSchemaKey (key :: SchemaKey) where {
- Data.Aeson.Schema.Key: fromSchemaKey :: forall key. IsSchemaKey key => String
+ Data.Aeson.Schema.Key: fromSchemaKey :: forall (key :: SchemaKey). IsSchemaKey key => String
- Data.Aeson.Schema.Key: showSchemaKey :: forall key. IsSchemaKey key => String
+ Data.Aeson.Schema.Key: showSchemaKey :: forall (key :: SchemaKey). IsSchemaKey key => String
- Data.Aeson.Schema.Key: type FromSchemaKey key :: Symbol;
+ Data.Aeson.Schema.Key: type FromSchemaKey (key :: SchemaKey) :: Symbol;
- Data.Aeson.Schema.Type: toSchemaV :: forall schema. IsSchemaObjectMap (FromSchema schema) => Proxy schema -> SchemaV
+ Data.Aeson.Schema.Type: toSchemaV :: forall (schema :: Schema). IsSchemaObjectMap (FromSchema schema) => Proxy schema -> SchemaV
- Data.Aeson.Schema.Utils.All: class All f xs
+ Data.Aeson.Schema.Utils.All: class All (f :: k -> Constraint) (xs :: k1)
- Data.Aeson.Schema.Utils.All: foldrAll :: All f xs => (forall x. f x => Proxy x -> a -> a) -> a -> a
+ Data.Aeson.Schema.Utils.All: foldrAll :: All f xs => (forall (x :: k). f x => Proxy x -> a -> a) -> a -> a
- Data.Aeson.Schema.Utils.All: mapAll :: forall a. All f xs => (forall x. f x => Proxy x -> a) -> [a]
+ Data.Aeson.Schema.Utils.All: mapAll :: All f xs => (forall (x :: k). f x => Proxy x -> a) -> [a]
- Data.Aeson.Schema.Utils.Compat: data () => Key
+ Data.Aeson.Schema.Utils.Compat: data Key
- Data.Aeson.Schema.Utils.Compat: data () => KeyMap v
+ Data.Aeson.Schema.Utils.Compat: data KeyMap v
- Data.Aeson.Schema.Utils.Sum: [Here] :: forall x xs. x -> SumType (x ': xs)
+ Data.Aeson.Schema.Utils.Sum: [Here] :: forall x (xs :: [Type]). x -> SumType (x ': xs)
- Data.Aeson.Schema.Utils.Sum: [There] :: forall x xs. SumType xs -> SumType (x ': xs)
+ Data.Aeson.Schema.Utils.Sum: [There] :: forall x (xs :: [Type]). SumType xs -> SumType (x ': xs)
- Data.Aeson.Schema.Utils.Sum: fromSumType :: (IsInRange n types, 'Just result ~ GetIndex n types, FromSumType n types result) => proxy n -> SumType types -> Maybe result
+ Data.Aeson.Schema.Utils.Sum: fromSumType :: forall (n :: Nat) (types :: [Type]) result proxy. (IsInRange n types, 'Just result ~ GetIndex n types, FromSumType n types result) => proxy n -> SumType types -> Maybe result
Files
- CHANGELOG.md +4/−0
- README.md +0/−1
- aeson-schemas.cabal +9/−13
- test/Tests/SchemaQQ.hs +9/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+# v1.4.3.1++* Add support for GHC 9.14+ # v1.4.3.0 * Drop support for GHC 9.4 + 9.6
README.md view
@@ -1,7 +1,6 @@ # aeson-schemas [](https://github.com/brandonchinn178/aeson-schemas/actions?query=branch%3Amain)-[](https://codecov.io/gh/brandonchinn178/aeson-schemas) [](https://hackage.haskell.org/package/aeson-schemas) A library that extracts information from JSON input using type-level schemas
aeson-schemas.cabal view
@@ -1,11 +1,7 @@ cabal-version: >= 1.10 --- This file has been generated from package.yaml by hpack version 0.37.0.------ see: https://github.com/sol/hpack- name: aeson-schemas-version: 1.4.3.0+version: 1.4.3.1 synopsis: Easily consume JSON data on-demand with type-safety description: Parse JSON data easily and safely without defining new data types. Useful for deeply nested JSON data, which is difficult to parse using the default@@ -78,14 +74,14 @@ src ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances -Wunused-packages build-depends:- aeson <3- , base >=4.17 && <5- , first-class-families <0.9- , hashable <1.6- , megaparsec <10- , template-haskell <2.24- , text <2.2- , unordered-containers <0.3+ base >=4.17 && <5+ , aeson+ , first-class-families+ , hashable+ , megaparsec+ , template-haskell+ , text+ , unordered-containers default-language: Haskell2010 test-suite aeson-schemas-test
test/Tests/SchemaQQ.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeApplications #-}@@ -146,7 +147,7 @@ , testCase "Object with a field with an unknown type" $ [schemaErr| { a: HelloWorld } |] @?= "Unknown type: HelloWorld" , testCase "Object extending a non-schema" $- [schemaErr| { #Int } |] @?= "'GHC.Types.Int' is not a Schema"+ [schemaErr| { #Int } |] @?= ghcTypesInt <> " is not a Schema" , testCase "Object importing an unknown schema" $ [schemaErr| { foo: #FooSchema } |] @?= "Unknown schema: FooSchema" , testCase "Object extending an unknown schema" $@@ -195,3 +196,10 @@ assertMatches a b = strip a @?= strip b where strip = Text.unpack . Text.strip . Text.pack++ghcTypesInt :: String+#if __GLASGOW_HASKELL__ < 914+ghcTypesInt = "'GHC.Types.Int'"+#else+ghcTypesInt = "'GHC.Internal.Types.Int'"+#endif