Module Openapi.Schema

OpenAPI Schema Objects.

Not exactly the same as JSON schemas.

type kind =
  1. | Boolean
  2. | Integer of {
    1. minimum : int option;
    2. maximum : int option;
    3. enum : int list option;
    }
  3. | Number of {
    1. minimum : float option;
    2. maximum : float option;
    }
  4. | String of {
    1. enum : string list option;
    2. pattern : string option;
    }
  5. | Array of t
  6. | Object of {
    1. properties : property list;
    2. additional_properties : t option;
    }
  7. | One_of of t list
  8. | Any

Nullable (i.e. non-ref) schemas.

and t =
  1. | Ref of string
  2. | Other of {
    1. title : string option;
    2. description : string option;
    3. nullable : bool;
    4. kind : kind;
    }
and property = {
  1. name : string;
  2. required : bool;
  3. schema : t;
}

Object fields.

type maker = ?title:string -> ?description:string -> ?nullable:bool -> unit -> t
val boolean : maker
val integer : ?minimum:int -> ?maximum:int -> ?enum:int list -> maker
val number : ?minimum:float -> ?maximum:float -> maker
val string : ?enum:string list -> ?pattern:string -> maker
val array : items:t -> maker
val obj : ?additional_properties:t -> properties:property list -> maker
val one_of : cases:t list -> maker
val any : maker
val reference : string -> t