timjb / aeson-schema Goto Github PK
View Code? Open in Web Editor NEW[OBSOLETE] Haskell JSON schema validator and parser generator
[OBSOLETE] Haskell JSON schema validator and parser generator
Any change the changes of the past couple of weeks could be pushed to Hackage? Old version doesn't build, and it's a pain to maintain a separate source build.
next goal: aeson-schema (dependency of contractor-0.1.0.0:*test)
rejecting: aeson-schema-0.2.0.1 (conflict: QuickCheck==2.7.6/installed-53f...,
aeson-schema => QuickCheck>=2.4.2 && <2.7)
rejecting: aeson-schema-0.2.0.0 (conflict: QuickCheck==2.7.6/installed-53f...,
aeson-schema => QuickCheck>=2.4.2 && <2.5)
rejecting: aeson-schema-0.1.1.0, 0.1.0.0 (conflict: contractor-0.1.0.0:test =>
aeson-schema>=0.2.0.0)
Dependency tree exhaustively searched.
@timjb Hi, Tim. I wonder if aeson-schema is maintained. If you're planning to support this project, can we at least update cabal manifest a little bit?
I saw you were a "stargazer" of json-schema/json-schema and saw this implementation. It is now into the list of implemenations on the web site:
http://json-schema.org/implementations.html
I honestly did not expect this language to be used for JSON Schema! Impressive...
I was just trying to build this on NixOS, and it complained about modules being missing when it tried to build the test suite...and sure enough, if you browse the tarball on hackage, the only thing included in test/ is TestSuite.hs
http://hackage.haskell.org/package/aeson-schema-0.3.0.0/src/test/
Hi, should there be some kind of test fixtures in this path? I just did a cabal build and cabal test and get this:
tests: test/test-suite/tests/draft3: getDirectoryContents: does not exist (No such file or directory)
Aeson Schema 0.2.0.1 and 0.2.0.0 fail to build from Cabal on GHC 7.6.3. The following errors occur.
cabal install aeson-schema
...
src/Data/Aeson/Schema/CodeGen.hs:419:74:
Couldn't match expected type `a0' with actual type `Int'
In the second argument of `V.unsafeIndex', namely `i'
In the first argument of `$itemParser', namely
`(V.unsafeIndex ($(varE arr)) i)'
In the Template Haskell quotation
[| $itemParser (V.unsafeIndex ($(varE arr)) i) |]
cabal: Error: some packages failed to install:
aeson-schema-0.2.0.0 failed during the building phase. The exception was:
ExitFailure 1
cabal install --only-dependencies # includes `aeson-schema==0.2.0.0`
...
src/Data/Aeson/Schema/CodeGen.hs:422:74:
Couldn't match expected type `a0' with actual type `Int'
In the second argument of `V.unsafeIndex', namely `i'
In the first argument of `$itemParser', namely
`(V.unsafeIndex ($(varE arr)) i)'
In the Template Haskell quotation
[| $itemParser (V.unsafeIndex ($(varE arr)) i) |]
Failed to install aeson-schema-0.2.0.1
Are there any plans to add support for draft4? There's a discussion of the draft4 changes here. I'd be happy to help with such an effort.
Resolving dependencies...
Configuring aeson-schema-0.3.0.3...
Building aeson-schema-0.3.0.3...
Preprocessing library aeson-schema-0.3.0.3...
[1 of 9] Compiling Data.Aeson.Schema.Choice.TH ( src/Data/Aeson/Schema/Choice/TH.hs, dist/build/Data/Aeson/Schema/Choice/TH.o )
src/Data/Aeson/Schema/Choice/TH.hs:7:1: Warning:
The import of ‘<$>’ from module ‘Control.Applicative’ is redundant
src/Data/Aeson/Schema/Choice/TH.hs:23:42: Warning:
In the use of ‘classP’
(imported from Language.Haskell.TH, but defined in Language.Haskell.TH.Lib):
Deprecated: "As of template-haskell-2.10, constraint predicates (Pred) are just types (Type), in keeping with ConstraintKinds. Please use 'conT' and 'appT'."
[2 of 9] Compiling Data.Aeson.TH.Lift ( src/Data/Aeson/TH/Lift.hs, dist/build/Data/Aeson/TH/Lift.o )
src/Data/Aeson/TH/Lift.hs:12:1: Warning:
The import of ‘Language.Haskell.TH’ is redundant
except perhaps to import instances from ‘Language.Haskell.TH’
To import instances alone, use: import Language.Haskell.TH()
[3 of 9] Compiling Data.Aeson.Schema.CodeGenM ( src/Data/Aeson/Schema/CodeGenM.hs, dist/build/Data/Aeson/Schema/CodeGenM.o )
src/Data/Aeson/Schema/CodeGenM.hs:14:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
src/Data/Aeson/Schema/CodeGenM.hs:22:1: Warning:
The import of ‘mconcat’ from module ‘Data.Monoid’ is redundant
src/Data/Aeson/Schema/CodeGenM.hs:66:10: Warning:
No explicit implementation for
‘qReifyRoles’, ‘qReifyAnnotations’, ‘qReifyModule’, ‘qAddTopDecls’,
‘qAddModFinalizer’, ‘qGetQ’, and ‘qPutQ’
In the instance declaration for ‘Quasi (CodeGenM s)’
[4 of 9] Compiling Data.Aeson.Schema.Helpers ( src/Data/Aeson/Schema/Helpers.hs, dist/build/Data/Aeson/Schema/Helpers.o )
[5 of 9] Compiling Data.Aeson.Schema.Choice ( src/Data/Aeson/Schema/Choice.hs, dist/build/Data/Aeson/Schema/Choice.o )
[6 of 9] Compiling Data.Aeson.Schema.Types ( src/Data/Aeson/Schema/Types.hs, dist/build/Data/Aeson/Schema/Types.o )
src/Data/Aeson/Schema/Types.hs:16:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
src/Data/Aeson/Schema/Types.hs:30:1: Warning:
The import of ‘Data.Functor’ is redundant
except perhaps to import instances from ‘Data.Functor’
To import instances alone, use: import Data.Functor()
src/Data/Aeson/Schema/Types.hs:37:1: Warning:
The import of ‘Data.Traversable’ is redundant
except perhaps to import instances from ‘Data.Traversable’
To import instances alone, use: import Data.Traversable()
[7 of 9] Compiling Data.Aeson.Schema.Validator ( src/Data/Aeson/Schema/Validator.hs, dist/build/Data/Aeson/Schema/Validator.o )
[8 of 9] Compiling Data.Aeson.Schema.CodeGen ( src/Data/Aeson/Schema/CodeGen.hs, dist/build/Data/Aeson/Schema/CodeGen.o )
src/Data/Aeson/Schema/CodeGen.hs:14:1: Warning:
The import of ‘<*>, Applicative, <$>’
from module ‘Control.Applicative’ is redundant
src/Data/Aeson/Schema/CodeGen.hs:34:1: Warning:
The import of ‘traverse’
from module ‘Data.Traversable’ is redundant
[9 of 9] Compiling Data.Aeson.Schema ( src/Data/Aeson/Schema.hs, dist/build/Data/Aeson/Schema.o )
In-place registering aeson-schema-0.3.0.3...
Preprocessing test suite 'tests' for aeson-schema-0.3.0.3...
[1 of 9] Compiling Data.Aeson.LitQQ ( test/Data/Aeson/LitQQ.hs, dist/build/tests/tests-tmp/Data/Aeson/LitQQ.o )
test/Data/Aeson/LitQQ.hs:7:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
test/Data/Aeson/LitQQ.hs:16:1: Warning:
The import of ‘Data.Aeson.Schema.CodeGen’ is redundant
except perhaps to import instances from ‘Data.Aeson.Schema.CodeGen’
To import instances alone, use: import Data.Aeson.Schema.CodeGen()
[2 of 9] Compiling Data.Aeson.Schema.Examples ( test/Data/Aeson/Schema/Examples.hs, dist/build/tests/tests-tmp/Data/Aeson/Schema/Examples.o )
[3 of 9] Compiling Paths_aeson_schema ( dist/build/autogen/Paths_aeson_schema.hs, dist/build/tests/tests-tmp/Paths_aeson_schema.o )
[4 of 9] Compiling TestSuite.Types ( test/TestSuite/Types.hs, dist/build/tests/tests-tmp/TestSuite/Types.o )
test/TestSuite/Types.hs:7:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
[5 of 9] Compiling Data.Aeson.Schema.Validator.Tests ( test/Data/Aeson/Schema/Validator/Tests.hs, dist/build/tests/tests-tmp/Data/Aeson/Schema/Validator/Tests.o )
[6 of 9] Compiling Data.Aeson.Schema.Types.Tests ( test/Data/Aeson/Schema/Types/Tests.hs, dist/build/tests/tests-tmp/Data/Aeson/Schema/Types/Tests.o )
[7 of 9] Compiling Data.Aeson.Schema.CodeGen.Tests ( test/Data/Aeson/Schema/CodeGen/Tests.hs, dist/build/tests/tests-tmp/Data/Aeson/Schema/CodeGen/Tests.o )
test/Data/Aeson/Schema/CodeGen/Tests.hs:19:1: Warning:
The import of ‘ioProperty’
from module ‘Test.QuickCheck.Property’ is redundant
test/Data/Aeson/Schema/CodeGen/Tests.hs:22:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
[8 of 9] Compiling Data.Aeson.Schema.Choice.Tests ( test/Data/Aeson/Schema/Choice/Tests.hs, dist/build/tests/tests-tmp/Data/Aeson/Schema/Choice/Tests.o )
test/Data/Aeson/Schema/Choice/Tests.hs:53:33:
No instance for (Foldable t0) arising from a use of ‘length’
The type variable ‘t0’ is ambiguous
Note: there are several potential instances:
instance Foldable Data.Aeson.Schema.Types.Schema
-- Defined in ‘Data.Aeson.Schema.Types’
instance Foldable (Control.Applicative.Const m)
-- Defined in ‘Control.Applicative’
instance Foldable (Either a) -- Defined in ‘Data.Foldable’
...plus 13 others
In the first argument of ‘choice3’, namely ‘length’
In the second argument of ‘(HU.@=?)’, namely
‘choice3 length id rnd (Choice2of3 4)’
In a stmt of a 'do' block:
(4 :: Int) HU.@=? choice3 length id rnd (Choice2of3 4)
test/Data/Aeson/Schema/Choice/Tests.hs:54:33:
No instance for (Foldable t1) arising from a use of ‘length’
The type variable ‘t1’ is ambiguous
Note: there are several potential instances:
instance Foldable Data.Aeson.Schema.Types.Schema
-- Defined in ‘Data.Aeson.Schema.Types’
instance Foldable (Control.Applicative.Const m)
-- Defined in ‘Control.Applicative’
instance Foldable (Either a) -- Defined in ‘Data.Foldable’
...plus 13 others
In the first argument of ‘choice3’, namely ‘length’
In the second argument of ‘(HU.@=?)’, namely
‘choice3 length id rnd (Choice3of3 (4.6 :: Double))’
In a stmt of a 'do' block:
(5 :: Int)
HU.@=? choice3 length id rnd (Choice3of3 (4.6 :: Double))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.