hjsonschema 0.5.3.1 → 0.5.3.2
raw patch · 3 files changed
+20/−20 lines, 3 filesdep +asyncdep +wai-app-staticdep +warpdep ~aesondep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: async, wai-app-static, warp
Dependency ranges changed: aeson, base
API changes (from Hackage documentation)
Files
- README.md +3/−11
- hjsonschema.cabal +6/−3
- tests/Remote.hs +11/−6
README.md view
@@ -4,11 +4,11 @@ # Status -Still in development. Lacks solid code to fetch remote schemas.+Still in development. Lacks solid code to handle changing resolution scope. # Example -```+```haskell {-# LANGUAGE OverloadedStrings #-} module Main where@@ -48,17 +48,9 @@ git submodule update --init -# Prepare Tests--+ `cd JSON-Schema-Test-Suite/remotes--+ `hserv --port=1234` / `python -m SimpleHTTPServer 1234`--Note that the `remote` test suite requires an internet connection.- # Notes -+ This uses the [regexpr](https://hackage.haskell.org/package/regexpr-0.5.4) regular expression library fo the "pattern" validator. I have no idea if this is compatible with the ECMA 262 regex dialect, which the [spec](http://json-schema.org/latest/json-schema-validation.html#anchor33) requires.++ This uses the [regexpr](https://hackage.haskell.org/package/regexpr-0.5.4) regular expression library for the "pattern" validator. I have no idea if this is compatible with the ECMA 262 regex dialect, which the [spec](http://json-schema.org/latest/json-schema-validation.html#anchor33) requires. + `draft4.json` is from commit # cc8ec81ce0abe2385ebd6c2a6f2d6deb646f874a [here](https://github.com/json-schema/json-schema).
hjsonschema.cabal view
@@ -1,5 +1,5 @@ name: hjsonschema-version: 0.5.3.1+version: 0.5.3.2 synopsis: JSON Schema Draft 4 library homepage: https://github.com/seagreen/hjsonschema license: MIT@@ -26,8 +26,8 @@ default-extensions: OverloadedStrings other-extensions: TemplateHaskell ghc-options: -Wall- build-depends: aeson >= 0.8 && < 0.9- , base >= 4.7 && < 4.9+ build-depends: aeson >= 0.7 && < 0.9+ , base >= 4.6 && < 4.9 , bytestring >= 0.10 && < 0.11 , file-embed >= 0.0.8 && < 0.0.9 , hashable >= 1.2 && < 1.3@@ -70,6 +70,7 @@ default-extensions: OverloadedStrings other-extensions: TemplateHaskell build-depends: aeson+ , async , base , bytestring , hjsonschema@@ -81,6 +82,8 @@ , HUnit >= 1.2 && < 1.3 , test-framework >= 0.8 && < 0.9 , test-framework-hunit >= 0.3 && < 0.4+ , wai-app-static+ , warp source-repository head type: git
tests/Remote.hs view
@@ -1,17 +1,22 @@ module Main where import Control.Applicative-import Data.List (isSuffixOf)+import Control.Concurrent.Async (withAsync)+import Data.List (isSuffixOf) import Lib-import System.Directory (getDirectoryContents)+import Network.Wai.Application.Static (defaultFileServerSettings,+ staticApp)+import Network.Wai.Handler.Warp (run)+import System.Directory (getDirectoryContents) import Test.Framework main :: IO ()-main = do- filenames <- filter (not . isLocal) . filter (".json" `isSuffixOf`)+main =+ withAsync (run 1234 $ staticApp $ defaultFileServerSettings "JSON-Schema-Test-Suite/remotes") $ \_ -> do+ filenames <- filter (not . isLocal) . filter (".json" `isSuffixOf`) <$> getDirectoryContents dir- ts <- readSchemaTests dir filenames- defaultMain (toTest <$> ts)+ ts <- readSchemaTests dir filenames+ defaultMain (toTest <$> ts) where dir :: String