hedgehog-gen-json-0.3.0: JSON generators for Hedgehog

Safe HaskellNone
LanguageHaskell2010

Hedgehog.Gen.JSON

Synopsis

Documentation

genJSON :: Ranges -> Gen ByteString Source #

Generator for arbitrary unconstrained JSON values encoded as UTF-8

genJSONValue :: Ranges -> Gen Value Source #

Generator for arbitrary unconstrained JSON values

genConstrainedJSON :: Ranges -> Schema -> Gen ByteString Source #

Generator for arbitrary JSON values constrained by the given JSON Schema and encoded as UTF-8

genConstrainedJSONValue :: Ranges -> Schema -> Gen Value Source #

Generator for arbitrary JSON values constrained by the given JSON Schema

data Schema Source #

Instances

Eq Schema Source # 

Methods

(==) :: Schema -> Schema -> Bool #

(/=) :: Schema -> Schema -> Bool #

Show Schema Source # 
Generic Schema Source # 

Associated Types

type Rep Schema :: * -> * #

Methods

from :: Schema -> Rep Schema x #

to :: Rep Schema x -> Schema #

FromJSON Schema Source # 
type Rep Schema Source # 
type Rep Schema

readSchema :: (MonadIO m, MonadThrow m) => FilePath -> m Schema Source #

Reads a JSON Schema from a filepath

newtype NumberRange Source #

Constructors

NumberRange 

newtype StringRange Source #

Constructors

StringRange 

newtype ArrayRange Source #

Constructors

ArrayRange 

newtype ObjectRange Source #

Constructors

ObjectRange 

sensibleRanges :: Ranges Source #

Sensible ranges for arbitrary JSON values if you're too lazy to define some

integerRange :: Lens' Ranges IntegerRange Source #