package goblint

  1. Overview
  2. Docs
Static analysis framework for C

Install

dune-project
 Dependency

Authors

Maintainers

Sources

goblint-1.1.1.tbz
sha256=999272bfbd3b9b96fcd58987b237ac6e9fa6d92ef935cc89f1ea2b4205185141
sha512=f3bf6ab71cf8c258d3290da4bf9f6fe42d7c671822e0efeb0fc50afdff078ab15e352237e5c1db31c5aa3a9d430691268ed2e5e00da10f2615835f672f91683d

doc/goblint.lib/JsonSchema/index.html

Module JsonSchema

A simpler schema than http://json-schema.org

type jtype =
  1. | JBool
  2. | JInt
  3. | JNum
  4. | JNull
  5. | JString
  6. | JArray of jarray
  7. | JObj of jobj

type of a jvalue

and jschema = {
  1. sid : string option;
    (*

    identificator

    *)
  2. sdescr : string option;
    (*

    description

    *)
  3. stype : jtype option;
    (*

    a type with possibly extra information

    *)
  4. sdefault : Yojson.Safe.t option;
    (*

    the default value

    *)
  5. mutable saddenum : jschema list;
    (*

    additional schemata that were loaded separately

    *)
}

a schema for a jvalue

and jarray = {
  1. sitem : jschema;
    (*

    the schema for all array elements

    *)
}

extra schema information for an array jvalue

and jobj = {
  1. sprops : (string * jschema) list;
    (*

    properties

    *)
  2. spatternprops : (string * jschema) list;
    (*

    regular expression properties

    *)
  3. sadditionalprops : bool;
    (*

    are all properties acounted in the schema

    *)
  4. srequired : string list;
    (*

    list of required properties

    *)
}

extra schema information for an object jvalue

exception JsonSchemaMalformed of string

An exception that indicates that some jschema is was invalid.

exception JsonMalformed of string

An exception that indicates that some jvalue was not valid according to some jschema.

val collectIds : jschema -> string list

Collect all ids from the jschema.

val validate : jschema -> Yojson.Safe.t -> unit

Call to validate s v validates the jvalue v in the jschema s. Invalidness is communicated using the exception JsonMalformed.

val fromJson : Yojson.Safe.t -> jschema

Convert a jvalue to a jschema if possible. Raise JsonSchemaMalformed otherwise.

val addenum : jschema -> jschema -> unit

Call to addenum x y extends x with y at the id Option.get y.sid

OCaml

Innovation. Community. Security.