packages feed

json-schema 0.6 → 0.6.1

raw patch · 3 files changed

+138/−10 lines, 3 filesdep ~aesondep ~attoparsecdep ~generic-aeson

Dependency ranges changed: aeson, attoparsec, generic-aeson, tasty, tasty-hunit, tasty-th, text

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+## 0.6.1++* Add JSONSchema instances for tuples up to length 15 (matching aeson 0.8 instances)+* Specify uniqueness for JSONSchema instances for Set.+ ## 0.6  Breaking changes:
json-schema.cabal view
@@ -1,5 +1,5 @@ name:                json-schema-version:             0.6+version:             0.6.1 synopsis:            Types and type classes for defining JSON schemas. description:         Types and type classes for defining JSON schemas. license:             BSD3@@ -29,7 +29,7 @@     Data.JSON.Schema.Types   build-depends:       base == 4.*-    , aeson >= 0.6 && < 0.8+    , aeson >= 0.6 && < 0.9     , containers >= 0.3 && < 0.6     , generic-aeson == 0.1.*     , generic-deriving == 1.6.*@@ -48,13 +48,12 @@       base     , HUnit >= 1.2 && < 1.3     , aeson-    , attoparsec+    , attoparsec >= 0.10 && < 0.13     , bytestring >= 0.10 && < 0.12-    , generic-aeson-    , tagged >= 0.2 && < 0.8+    , generic-aeson == 0.1.*     , json-schema     , tagged >= 0.2 && < 0.8-    , tasty-    , tasty-hunit-    , tasty-th-    , text+    , tasty == 0.8.*+    , tasty-hunit == 0.8.*+    , tasty-th == 0.1.*+    , text >= 0.10 && < 1.2
src/Data/JSON/Schema/Types.hs view
@@ -118,7 +118,7 @@   schema _ = Value LengthBound { lowerLength = Just 20, upperLength = Just 24 }  instance JSONSchema a => JSONSchema (S.Set a) where-  schema = schema . fmap S.toList+  schema = Array unboundedLength True . schema . fmap S.findMin  instance (JSONSchema a, JSONSchema b) => JSONSchema (a, b) where   schema s = Tuple@@ -169,4 +169,128 @@     , schema . fmap (\(_,_,_,_,e,_,_) -> e) $ s     , schema . fmap (\(_,_,_,_,_,f,_) -> f) $ s     , schema . fmap (\(_,_,_,_,_,_,g) -> g) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h) => JSONSchema (a, b, c, d, e, f, g, h) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h) -> h) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i) => JSONSchema (a, b, c, d, e, f, g, h, i) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i) -> i) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j) => JSONSchema (a, b, c, d, e, f, g, h, i, j) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i,_) -> i) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,j) -> j) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_,_,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i,_,_) -> i) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,j,_) -> j) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,k) -> k) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_,_,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_,_,_,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i,_,_,_) -> i) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,j,_,_) -> j) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,k,_) -> k) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,l) -> l) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l, JSONSchema m) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l, m) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_,_,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_,_,_,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_,_,_,_,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i,_,_,_,_) -> i) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,j,_,_,_) -> j) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,k,_,_) -> k) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,l,_) -> l) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,_,m) -> m) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l, JSONSchema m, JSONSchema n) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l, m, n) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_,_,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_,_,_,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_,_,_,_,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_,_,_,_,_,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i,_,_,_,_,_) -> i) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,j,_,_,_,_) -> j) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,k,_,_,_) -> k) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,l,_,_) -> l) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,_,m,_) -> m) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,_,_,n) -> n) $ s+    ]++instance (JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l, JSONSchema m, JSONSchema n, JSONSchema o) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) where+  schema s = Tuple+    [ schema . fmap (\(a,_,_,_,_,_,_,_,_,_,_,_,_,_,_) -> a) $ s+    , schema . fmap (\(_,b,_,_,_,_,_,_,_,_,_,_,_,_,_) -> b) $ s+    , schema . fmap (\(_,_,c,_,_,_,_,_,_,_,_,_,_,_,_) -> c) $ s+    , schema . fmap (\(_,_,_,d,_,_,_,_,_,_,_,_,_,_,_) -> d) $ s+    , schema . fmap (\(_,_,_,_,e,_,_,_,_,_,_,_,_,_,_) -> e) $ s+    , schema . fmap (\(_,_,_,_,_,f,_,_,_,_,_,_,_,_,_) -> f) $ s+    , schema . fmap (\(_,_,_,_,_,_,g,_,_,_,_,_,_,_,_) -> g) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,h,_,_,_,_,_,_,_) -> h) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,i,_,_,_,_,_,_) -> i) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,j,_,_,_,_,_) -> j) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,k,_,_,_,_) -> k) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,l,_,_,_) -> l) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,_,m,_,_) -> m) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,_,_,n,_) -> n) $ s+    , schema . fmap (\(_,_,_,_,_,_,_,_,_,_,_,_,_,_,o) -> o) $ s     ]