Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on hjsonschema #286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
index-state:
, hackage.haskell.org 2024-11-14T09:17:39Z
, cardano-haskell-packages 2024-11-20T20:05:41Z

-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them

Expand All @@ -26,19 +26,6 @@ repository ghcjs-overlay
d5f108840fa2addca04caa82bc4c60ce41df7c0d3133baf6716b05a4dce11b6c
key-threshold: 3

-- Avoid conflict in `hjsonschema`
-- src/Import.hs:2:16: error: [GHC-69158]
-- Conflicting exports for ‘witness’:
-- ‘module Export’ exports ‘Export.witness’
-- imported from ‘Protolude’ at src/Import.hs:4:1-36
-- (and originally defined in ‘Protolude.Debug’)
-- ‘module Export’ exports ‘Export.witness’
-- imported from ‘Test.QuickCheck’ at src/Import.hs:(9,1)-(10,50)
-- (and originally defined in ‘Test.QuickCheck.Property’)
-- TODO update https://github.com/input-output-hk/hjsonschema to
-- hide `witness` when importing from `Test.QuickCheck`
constraints: QuickCheck <2.15

if os(ghcjs)
extra-packages: ghci

Expand Down
6 changes: 1 addition & 5 deletions command-line/cardano-addresses-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,4 @@ test-suite unit
Win32
if flag(release)
ghc-options: -Werror
if !(impl(ghcjs) || os(ghcjs))
cpp-options: -DHJSONSCHEMA
build-depends:
hjsonschema >=1.10.0
default-language: Haskell2010
default-language: Haskell2010
11 changes: 0 additions & 11 deletions command-line/test/Test/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,4 @@ newtype SchemaRef = SchemaRef
} deriving (Show, IsString)

validateJSON :: SchemaRef -> Json.Value -> IO [String]
#ifdef HJSONSCHEMA
validateJSON (SchemaRef ref) value = do
let schema = SchemaWithURI (emptySchema { _schemaRef = Just ref }) Nothing
refs <- unsafeIO =<< referencesViaFilesystem schema
validate <- unsafeIO (checkSchema refs schema)
pure $ map show $ validate value
where
unsafeIO :: Show e => Either e a -> IO a
unsafeIO = either (fail . show) pure
#else
validateJSON _ _ = pure []
#endif
Loading