summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexeyraga <>2019-02-06 04:07:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-02-06 04:07:00 (GMT)
commite1e400fa06ce84a7a433b00f89940e4b21a55a05 (patch)
tree21e66642a596041bba644b87f24a403ca440b73c
parent7459565b9c9730a9d0d4fccaee1d1048acc34e78 (diff)
version 0.4.2.00.4.2.0
-rwxr-xr-x[-rw-r--r--]ChangeLog.md0
-rwxr-xr-x[-rw-r--r--]README.md0
-rw-r--r--avro.cabal9
-rw-r--r--src/Data/Avro/Deriving.hs76
-rw-r--r--src/Data/Avro/JSON.hs8
-rw-r--r--src/Data/Avro/Schema.hs68
-rw-r--r--test/Avro/JSONSpec.hs35
-rw-r--r--test/Avro/THUnionSpec.hs47
-rwxr-xr-x[-rw-r--r--]test/data/deconflict/reader.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/deconflict/writer.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/enums-object.json0
-rwxr-xr-x[-rw-r--r--]test/data/enums.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/internal-bindings.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/karma.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/logical.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/maybe.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/namespace-inference.json0
-rwxr-xr-x[-rw-r--r--]test/data/overlay/composite.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/overlay/expectation.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/overlay/primitives.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/record.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/reused.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/small.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/unions-no-namespace.avsc0
-rwxr-xr-x[-rw-r--r--]test/data/unions-object-a.json3
-rwxr-xr-x[-rw-r--r--]test/data/unions-object-b.json3
-rwxr-xr-x[-rw-r--r--]test/data/unions.avsc10
27 files changed, 130 insertions, 129 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index 5c22a82..5c22a82 100644..100755
--- a/ChangeLog.md
+++ b/ChangeLog.md
diff --git a/README.md b/README.md
index bb6c73c..bb6c73c 100644..100755
--- a/README.md
+++ b/README.md
diff --git a/avro.cabal b/avro.cabal
index 6bd4e77..a4eedfa 100644
--- a/avro.cabal
+++ b/avro.cabal
@@ -1,13 +1,7 @@
cabal-version: 1.12
--- This file has been generated from package.yaml by hpack version 0.31.1.
---
--- see: https://github.com/sol/hpack
---
--- hash: ca29cdadb7a7a9edda357686a62ea84b9122a6bedb7fe04890a5d1fcc8719127
-
name: avro
-version: 0.4.1.2
+version: 0.4.2.0
synopsis: Avro serialization support for Haskell
description: Avro serialization and deserialization support for Haskell
category: Data
@@ -88,7 +82,6 @@ library
hs-source-dirs:
src
other-extensions: OverloadedStrings
- ghc-options: -O2
build-depends:
aeson
, array
diff --git a/src/Data/Avro/Deriving.hs b/src/Data/Avro/Deriving.hs
index 88aeed8..8ba6516 100644
--- a/src/Data/Avro/Deriving.hs
+++ b/src/Data/Avro/Deriving.hs
@@ -32,41 +32,41 @@ module Data.Avro.Deriving
)
where
-import Control.Monad (join)
-import Data.Aeson (eitherDecode)
-import qualified Data.Aeson as J
-import Data.Avro hiding (decode, encode)
-import Data.Avro.Schema as S
-import qualified Data.Avro.Types as AT
-import Data.ByteString (ByteString)
-import qualified Data.ByteString as B
-import Data.Char (isAlphaNum)
+import Control.Monad (join)
+import Data.Aeson (eitherDecode)
+import qualified Data.Aeson as J
+import Data.Avro hiding (decode, encode)
+import Data.Avro.Schema as S
+import qualified Data.Avro.Types as AT
+import Data.ByteString (ByteString)
+import qualified Data.ByteString as B
+import Data.Char (isAlphaNum)
import Data.Int
-import Data.List.NonEmpty (NonEmpty ((:|)))
-import qualified Data.List.NonEmpty as NE
-import Data.Map (Map)
-import Data.Maybe (fromMaybe)
-import Data.Semigroup ((<>))
-import qualified Data.Text as Text
+import Data.List.NonEmpty (NonEmpty ((:|)))
+import qualified Data.List.NonEmpty as NE
+import Data.Map (Map)
+import Data.Maybe (fromMaybe)
+import Data.Semigroup ((<>))
+import qualified Data.Text as Text
-import GHC.Generics (Generic)
+import GHC.Generics (Generic)
-import Language.Haskell.TH as TH hiding (notStrict)
-import Language.Haskell.TH.Lib as TH hiding (notStrict)
-import Language.Haskell.TH.Syntax
+import Language.Haskell.TH as TH hiding (notStrict)
+import Language.Haskell.TH.Lib as TH hiding (notStrict)
+import Language.Haskell.TH.Syntax
-import Data.Avro.Deriving.NormSchema
-import Data.Avro.EitherN
+import Data.Avro.Deriving.NormSchema
+import Data.Avro.EitherN
-import qualified Data.ByteString as BS
-import qualified Data.ByteString.Lazy as LBS
-import qualified Data.ByteString.Lazy.Char8 as LBSC8
-import qualified Data.HashMap.Strict as HM
-import qualified Data.Set as S
-import Data.Text (Text)
-import qualified Data.Text as T
-import qualified Data.Vector as V
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Lazy as LBS
+import qualified Data.ByteString.Lazy.Char8 as LBSC8
+import qualified Data.HashMap.Strict as HM
+import qualified Data.Set as S
+import Data.Text (Text)
+import qualified Data.Text as T
+import qualified Data.Vector as V
import Data.Avro.Decode.Lazy.FromLazyAvro
import qualified Data.Avro.Decode.Lazy.LazyValue as LV
@@ -110,14 +110,14 @@ data DeriveOptions = DeriveOptions
{ -- | How to build field names for generated data types. The first
-- argument is the type name to use as a prefix, rendered
-- according to the 'namespaceBehavior' setting.
- fieldNameBuilder :: Text -> Field -> T.Text
+ fieldNameBuilder :: Text -> Field -> T.Text
-- | Determines field representation of generated data types
- , fieldRepresentation :: TypeName -> Field -> (FieldStrictness, FieldUnpackedness)
+ , fieldRepresentation :: TypeName -> Field -> (FieldStrictness, FieldUnpackedness)
-- | Controls how we handle namespaces when defining Haskell type
-- and field names.
- , namespaceBehavior :: NamespaceBehavior
+ , namespaceBehavior :: NamespaceBehavior
} deriving Generic
-- | Default deriving options
@@ -672,10 +672,10 @@ genNewtype dn = do
pure $ NewtypeD [] dn [] Nothing ctor ders
#else
genNewtype dn = do
- [ConT eq, ConT sh] <- sequenceA [[t|Eq|], [t|Show|], [t|Generic|]]
+ [ConT eq, ConT sh, ConT gen] <- sequenceA [[t|Eq|], [t|Show|], [t|Generic|]]
fldType <- [t|ByteString|]
let ctor = RecC dn [(mkName ("un" ++ nameBase dn), notStrict, fldType)]
- pure $ NewtypeD [] dn [] ctor [eq, sh]
+ pure $ NewtypeD [] dn [] ctor [eq, sh, gen]
#endif
genEnum :: Name -> [Name] -> Q Dec
@@ -689,8 +689,8 @@ genEnum dn vs = do
pure $ DataD [] dn [] Nothing ((\n -> NormalC n []) <$> vs) ders
#else
genEnum dn vs = do
- [ConT eq, ConT sh, ConT or, ConT en] <- sequenceA [[t|Eq|], [t|Show|], [t|Ord|], [t|Enum|], [t|Generic|]]
- pure $ DataD [] dn [] ((\n -> NormalC n []) <$> vs) [eq, sh, or, en]
+ [ConT eq, ConT sh, ConT or, ConT en, ConT gen] <- sequenceA [[t|Eq|], [t|Show|], [t|Ord|], [t|Enum|], [t|Generic|]]
+ pure $ DataD [] dn [] ((\n -> NormalC n []) <$> vs) [eq, sh, or, en, gen]
#endif
genDataType :: Name -> [VarStrictType] -> Q Dec
@@ -704,8 +704,8 @@ genDataType dn flds = do
pure $ DataD [] dn [] Nothing [RecC dn flds] ders
#else
genDataType dn flds = do
- [ConT eq, ConT sh] <- sequenceA [[t|Eq|], [t|Show|], [t|Generic|]]
- pure $ DataD [] dn [] [RecC dn flds] [eq, sh]
+ [ConT eq, ConT sh, ConT gen] <- sequenceA [[t|Eq|], [t|Show|], [t|Generic|]]
+ pure $ DataD [] dn [] [RecC dn flds] [eq, sh, gen]
#endif
notStrict :: Strict
diff --git a/src/Data/Avro/JSON.hs b/src/Data/Avro/JSON.hs
index b6cd840..8af4e0d 100644
--- a/src/Data/Avro/JSON.hs
+++ b/src/Data/Avro/JSON.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Avro supports a JSON representation of Avro objects alongside the
-- Avro binary format. An Avro schema can be used to generate and
@@ -97,8 +98,8 @@ decodeAvroJSON schema json =
| otherwise =
let
canonicalize name
- | Just _ <- Schema.primitiveType name = name
- | otherwise = Schema.renderFullname $ Schema.parseFullname name
+ | isBuiltIn name = name
+ | otherwise = Schema.renderFullname $ Schema.parseFullname name
branch =
head $ HashMap.keys obj
names =
@@ -113,6 +114,9 @@ decodeAvroJSON schema json =
union _ _ =
error "Impossible: function given non-union schema."
+ isBuiltIn name = name `elem` [ "null", "boolean", "int", "long", "float"
+ , "double", "bytes", "string", "array", "map" ]
+
-- | Convert a 'Aeson.Value' into a type that has an Avro schema. The
-- schema is used to validate the JSON and will return an 'Error' if
-- the JSON object is not encoded correctly or does not match the schema.
diff --git a/src/Data/Avro/Schema.hs b/src/Data/Avro/Schema.hs
index 2edd518..f732439 100644
--- a/src/Data/Avro/Schema.hs
+++ b/src/Data/Avro/Schema.hs
@@ -27,7 +27,6 @@ module Data.Avro.Schema
, validateSchema
-- * Lower level utilities
, typeName
- , primitiveType
, buildTypeEnvironment
, extractBindings
@@ -51,34 +50,33 @@ import Control.Monad.Except
import qualified Control.Monad.Fail as MF
import Control.Monad.State.Strict
-import Data.Aeson (FromJSON (..), ToJSON (..), object,
- (.!=), (.:), (.:!), (.:?), (.=))
-import qualified Data.Aeson as A
-import Data.Aeson.Types (Parser, typeMismatch)
-import qualified Data.Avro.Types as Ty
-import qualified Data.ByteString as B
-import qualified Data.ByteString.Base16 as Base16
-import qualified Data.Char as Char
-import Data.Function (on)
+import Data.Aeson (FromJSON (..), ToJSON (..), object, (.!=), (.:), (.:!), (.:?), (.=))
+import qualified Data.Aeson as A
+import Data.Aeson.Types (Parser, typeMismatch)
+import qualified Data.Avro.Types as Ty
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Base16 as Base16
+import qualified Data.Char as Char
+import Data.Function (on)
import Data.Hashable
-import qualified Data.HashMap.Strict as HashMap
+import qualified Data.HashMap.Strict as HashMap
import Data.Int
-import qualified Data.IntMap as IM
-import qualified Data.List as L
-import Data.List.NonEmpty (NonEmpty (..))
-import qualified Data.List.NonEmpty as NE
-import Data.Maybe (catMaybes, fromMaybe, isJust)
-import Data.Monoid (First (..))
+import qualified Data.IntMap as IM
+import qualified Data.List as L
+import Data.List.NonEmpty (NonEmpty (..))
+import qualified Data.List.NonEmpty as NE
+import Data.Maybe (catMaybes, fromMaybe, isJust)
+import Data.Monoid (First (..))
import Data.Semigroup
-import qualified Data.Set as S
+import qualified Data.Set as S
import Data.String
-import Data.Text (Text)
-import qualified Data.Text as T
-import Data.Text.Encoding as T
-import qualified Data.Vector as V
-import Prelude as P
+import Data.Text (Text)
+import qualified Data.Text as T
+import Data.Text.Encoding as T
+import qualified Data.Vector as V
+import Prelude as P
-import Text.Show.Functions ()
+import Text.Show.Functions ()
-- |An Avro schema is either
-- * A "JSON object in the form `{"type":"typeName" ...`
@@ -297,27 +295,6 @@ typeName bt =
Union (x:|_) _ -> typeName x
_ -> renderFullname $ name bt
--- | If the given string is the name of a primitive type, return the
--- type, otherwise return 'Nothing'.
---
--- @
--- λ> primitiveType "string"
--- Just String
--- λ> primitiveType "foo"
--- Nothing
--- @
-primitiveType :: Text -> Maybe Type
-primitiveType = \case
- "null" -> Just Null
- "boolean" -> Just Boolean
- "int" -> Just Int
- "long" -> Just Long
- "float" -> Just Float
- "double" -> Just Double
- "bytes" -> Just Bytes
- "string" -> Just String
- _ -> Nothing
-
data Field = Field { fldName :: Text
, fldAliases :: [Text]
, fldDoc :: Maybe Text
@@ -565,6 +542,7 @@ instance Semigroup (Result a) where
(<>) = mplus
instance Monoid (Result a) where
mempty = fail "Empty Result"
+ mappend = (<>)
instance Foldable Result where
foldMap _ (Error _) = mempty
foldMap f (Success y) = f y
diff --git a/test/Avro/JSONSpec.hs b/test/Avro/JSONSpec.hs
index 5629ed5..d6eb5b2 100644
--- a/test/Avro/JSONSpec.hs
+++ b/test/Avro/JSONSpec.hs
@@ -8,6 +8,7 @@ import Control.Monad (forM_)
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as LBS
+import qualified Data.Map as Map
import Data.Avro.Deriving
import Data.Avro.EitherN
@@ -69,24 +70,26 @@ spec = describe "Avro.JSONSpec: JSON serialization/parsing" $ do
let expected = EnumWrapper 37 "blarg" EnumReasonInstead
parseJSON enumsExampleJSON `shouldBe` pure expected
let unionsExampleA = Unions
- { unionsScalars = Left "blarg"
- , unionsNullable = Nothing
- , unionsRecords = Left $ Foo { fooStuff = "stuff" }
- , unionsSameFields = Left $ Foo { fooStuff = "foo stuff" }
- , unionsThree = E3_1 37
- , unionsFour = E4_2 "foo"
- , unionsFive = E5_4 $ Foo { fooStuff = "foo stuff" }
+ { unionsScalars = Left "blarg"
+ , unionsNullable = Nothing
+ , unionsRecords = Left $ Foo { fooStuff = "stuff" }
+ , unionsSameFields = Left $ Foo { fooStuff = "foo stuff" }
+ , unionsArrayAndMap = Left ["foo"]
+ , unionsThree = E3_1 37
+ , unionsFour = E4_2 "foo"
+ , unionsFive = E5_4 $ Foo { fooStuff = "foo stuff" }
}
unionsExampleB = Unions
- { unionsScalars = Right 37
- , unionsNullable = Just 42
- , unionsRecords = Right $ Bar { barStuff = "stuff"
- , barThings = Foo "things"
- }
- , unionsSameFields = Right $ NotFoo { notFooStuff = "not foo stuff" }
- , unionsThree = E3_3 37
- , unionsFour = E4_4 $ Foo { fooStuff = "foo stuff" }
- , unionsFive = E5_5 $ NotFoo { notFooStuff = "not foo stuff" }
+ { unionsScalars = Right 37
+ , unionsNullable = Just 42
+ , unionsRecords = Right $ Bar { barStuff = "stuff"
+ , barThings = Foo "things"
+ }
+ , unionsSameFields = Right $ NotFoo { notFooStuff = "not foo stuff" }
+ , unionsArrayAndMap = Right $ Map.fromList [("a", 5)]
+ , unionsThree = E3_3 37
+ , unionsFour = E4_4 $ Foo { fooStuff = "foo stuff" }
+ , unionsFive = E5_5 $ NotFoo { notFooStuff = "not foo stuff" }
}
it "should roundtrip (unions)" $ do
forM_ [unionsExampleA, unionsExampleB] $ \ msg ->
diff --git a/test/Avro/THUnionSpec.hs b/test/Avro/THUnionSpec.hs
index 161b388..852c917 100644
--- a/test/Avro/THUnionSpec.hs
+++ b/test/Avro/THUnionSpec.hs
@@ -14,6 +14,7 @@ import Data.Avro.EitherN
import qualified Data.Avro.Schema as Schema
import qualified Data.Avro.Types as Avro
import qualified Data.ByteString.Lazy as LBS
+import qualified Data.Map as Map
import System.Directory (doesFileExist)
@@ -26,24 +27,26 @@ deriveAvro "test/data/unions.avsc"
spec :: Spec
spec = describe "Avro.THUnionSpec: Schema with unions." $ do
let objA = Unions
- { unionsScalars = Left "foo"
- , unionsNullable = Nothing
- , unionsRecords = Left $ Foo { fooStuff = "stuff" }
- , unionsSameFields = Left $ Foo { fooStuff = "more stuff" }
- , unionsThree = E3_1 37
- , unionsFour = E4_2 "foo"
- , unionsFive = E5_4 $ Foo { fooStuff = "foo stuff" }
+ { unionsScalars = Left "foo"
+ , unionsNullable = Nothing
+ , unionsRecords = Left $ Foo { fooStuff = "stuff" }
+ , unionsSameFields = Left $ Foo { fooStuff = "more stuff" }
+ , unionsArrayAndMap = Left ["foo"]
+ , unionsThree = E3_1 37
+ , unionsFour = E4_2 "foo"
+ , unionsFive = E5_4 $ Foo { fooStuff = "foo stuff" }
}
objB = Unions
- { unionsScalars = Right 42
- , unionsNullable = Just 37
- , unionsRecords = Right $ Bar { barStuff = "stuff"
- , barThings = Foo { fooStuff = "things" }
- }
- , unionsSameFields = Right $ NotFoo { notFooStuff = "different from Foo" }
- , unionsThree = E3_3 37
- , unionsFour = E4_4 $ Foo { fooStuff = "foo stuff" }
- , unionsFive = E5_5 $ NotFoo { notFooStuff = "not foo stuff" }
+ { unionsScalars = Right 42
+ , unionsNullable = Just 37
+ , unionsRecords = Right $ Bar { barStuff = "stuff"
+ , barThings = Foo { fooStuff = "things" }
+ }
+ , unionsSameFields = Right $ NotFoo { notFooStuff = "different from Foo" }
+ , unionsArrayAndMap = Right $ Map.fromList [("a", 5)]
+ , unionsThree = E3_3 37
+ , unionsFour = E4_4 $ Foo { fooStuff = "foo stuff" }
+ , unionsFive = E5_5 $ NotFoo { notFooStuff = "not foo stuff" }
}
field name schema def = Schema.Field name [] Nothing (Just Schema.Ascending) schema def
@@ -54,10 +57,11 @@ spec = describe "Avro.THUnionSpec: Schema with unions." $ do
foo = named "haskell.avro.example.Foo"
notFoo = named "haskell.avro.example.NotFoo"
expectedSchema = record "haskell.avro.example.Unions"
- [ field "scalars" (Schema.mkUnion (NE.fromList [Schema.String, Schema.Long])) scalarsDefault
- , field "nullable" (Schema.mkUnion (NE.fromList [Schema.Null, Schema.Int])) nullableDefault
- , field "records" (Schema.mkUnion (NE.fromList [fooSchema, barSchema])) Nothing
- , field "sameFields" (Schema.mkUnion (NE.fromList [foo, notFooSchema])) Nothing
+ [ field "scalars" (Schema.mkUnion (NE.fromList [Schema.String, Schema.Long])) scalarsDefault
+ , field "nullable" (Schema.mkUnion (NE.fromList [Schema.Null, Schema.Int])) nullableDefault
+ , field "records" (Schema.mkUnion (NE.fromList [fooSchema, barSchema])) Nothing
+ , field "sameFields" (Schema.mkUnion (NE.fromList [foo, notFooSchema])) Nothing
+ , field "arrayAndMap" (Schema.mkUnion (NE.fromList [array, map])) Nothing
, field "three" (Schema.mkUnion (NE.fromList [Schema.Int, Schema.String, Schema.Long])) Nothing
, field "four" (Schema.mkUnion (NE.fromList [Schema.Int, Schema.String, Schema.Long, foo])) Nothing
@@ -73,6 +77,9 @@ spec = describe "Avro.THUnionSpec: Schema with unions." $ do
]
notFooSchema = record "haskell.avro.example.NotFoo" [field "stuff" Schema.String Nothing]
+ array = Schema.Array { Schema.item = Schema.String }
+ map = Schema.Map { Schema.values = Schema.Long }
+
unionsSchemaFile <- runIO $ getFileName "test/data/unions.avsc" >>= LBS.readFile
let Just unionsSchemaFromJSON = Aeson.decode unionsSchemaFile
diff --git a/test/data/deconflict/reader.avsc b/test/data/deconflict/reader.avsc
index 7c458c9..7c458c9 100644..100755
--- a/test/data/deconflict/reader.avsc
+++ b/test/data/deconflict/reader.avsc
diff --git a/test/data/deconflict/writer.avsc b/test/data/deconflict/writer.avsc
index 374fe32..374fe32 100644..100755
--- a/test/data/deconflict/writer.avsc
+++ b/test/data/deconflict/writer.avsc
diff --git a/test/data/enums-object.json b/test/data/enums-object.json
index e069427..e069427 100644..100755
--- a/test/data/enums-object.json
+++ b/test/data/enums-object.json
diff --git a/test/data/enums.avsc b/test/data/enums.avsc
index 3f3a2e7..3f3a2e7 100644..100755
--- a/test/data/enums.avsc
+++ b/test/data/enums.avsc
diff --git a/test/data/internal-bindings.avsc b/test/data/internal-bindings.avsc
index c58e30c..c58e30c 100644..100755
--- a/test/data/internal-bindings.avsc
+++ b/test/data/internal-bindings.avsc
diff --git a/test/data/karma.avsc b/test/data/karma.avsc
index 3ba4a9d..3ba4a9d 100644..100755
--- a/test/data/karma.avsc
+++ b/test/data/karma.avsc
diff --git a/test/data/logical.avsc b/test/data/logical.avsc
index e2c47cf..e2c47cf 100644..100755
--- a/test/data/logical.avsc
+++ b/test/data/logical.avsc
diff --git a/test/data/maybe.avsc b/test/data/maybe.avsc
index 75404e1..75404e1 100644..100755
--- a/test/data/maybe.avsc
+++ b/test/data/maybe.avsc
diff --git a/test/data/namespace-inference.json b/test/data/namespace-inference.json
index eaac755..eaac755 100644..100755
--- a/test/data/namespace-inference.json
+++ b/test/data/namespace-inference.json
diff --git a/test/data/overlay/composite.avsc b/test/data/overlay/composite.avsc
index a4b4fdd..a4b4fdd 100644..100755
--- a/test/data/overlay/composite.avsc
+++ b/test/data/overlay/composite.avsc
diff --git a/test/data/overlay/expectation.avsc b/test/data/overlay/expectation.avsc
index 88fd991..88fd991 100644..100755
--- a/test/data/overlay/expectation.avsc
+++ b/test/data/overlay/expectation.avsc
diff --git a/test/data/overlay/primitives.avsc b/test/data/overlay/primitives.avsc
index 61f8cd2..61f8cd2 100644..100755
--- a/test/data/overlay/primitives.avsc
+++ b/test/data/overlay/primitives.avsc
diff --git a/test/data/record.avsc b/test/data/record.avsc
index 8371d51..8371d51 100644..100755
--- a/test/data/record.avsc
+++ b/test/data/record.avsc
diff --git a/test/data/reused.avsc b/test/data/reused.avsc
index 4449232..4449232 100644..100755
--- a/test/data/reused.avsc
+++ b/test/data/reused.avsc
diff --git a/test/data/small.avsc b/test/data/small.avsc
index 01247c3..01247c3 100644..100755
--- a/test/data/small.avsc
+++ b/test/data/small.avsc
diff --git a/test/data/unions-no-namespace.avsc b/test/data/unions-no-namespace.avsc
index 3e40484..3e40484 100644..100755
--- a/test/data/unions-no-namespace.avsc
+++ b/test/data/unions-no-namespace.avsc
diff --git a/test/data/unions-object-a.json b/test/data/unions-object-a.json
index e319c08..e2c49b6 100644..100755
--- a/test/data/unions-object-a.json
+++ b/test/data/unions-object-a.json
@@ -13,6 +13,9 @@
"stuff": "foo stuff"
}
},
+ "arrayAndMap" : {
+ "array" : ["foo"]
+ },
"three": { "int": 37 },
"four": { "string": "foo" },
"five": {
diff --git a/test/data/unions-object-b.json b/test/data/unions-object-b.json
index c1d43aa..d384a22 100644..100755
--- a/test/data/unions-object-b.json
+++ b/test/data/unions-object-b.json
@@ -18,6 +18,9 @@
"stuff": "not foo stuff"
}
},
+ "arrayAndMap" : {
+ "map" : { "a" : 5 }
+ },
"three": { "long": 37 },
"four": {
"haskell.avro.example.Foo": { "stuff" : "foo stuff" }
diff --git a/test/data/unions.avsc b/test/data/unions.avsc
index 8508d03..5628a07 100644..100755
--- a/test/data/unions.avsc
+++ b/test/data/unions.avsc
@@ -44,6 +44,16 @@
}
]
},
+ { "name" : "arrayAndMap",
+ "type" : [
+ { "type" : "array",
+ "items" : "string"
+ },
+ { "type" : "map",
+ "values" : "long"
+ }
+ ]
+ },
{ "name" : "three", "type" : ["int", "string", "long"] },
{ "name" : "four", "type" : ["int", "string", "long", "Foo"] },
{ "name" : "five", "type" : ["int", "string", "long", "Foo", "NotFoo"] }