1module JSONSchema.Types where
5import JSONSchema.Validator.Types (Validator(..))
8 = Spec { _unSpec :: [Validator schema schema err] }
10-- | Return a schema's immediate subschemas.
12-- The first list is subschemas validating the same level of the document,
13-- the second list is subschemas validating lower levels (see
14-- 'JSONSchema.Validator.Types.Fail' for a full explanation).
15embedded :: Spec schema a -> schema -> ([schema], [schema])
17 let embeds = (\val -> _embedded val schema) <$> _unSpec spec
18 in foldl' (\(a,b) (x,y) -> (x <> a, y <> b)) (mempty, mempty) embeds
25validate spec schema v =
26 (\val -> _validate val schema v) =<< _unSpec spec
28-- | A basic schema type that doesn't impose much structure.
30-- 'JSONSchema.Draft4' doesn't use this, but instead uses the record based
31-- one defined in 'JSONSchema.Draft4.Schema' to make it easier to write
32-- draft 4 schemas in Haskell.
34 = Schema { _unSchema :: HashMap Text Value }
35 deriving (Eq, Show, FromJSON, ToJSON)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list