fixup 242c97d1 ocplib-json-types: 'Variable defintion path in json_schema'

This commit is contained in:
Pierre Boutillier 2019-01-23 12:39:25 +01:00
parent 7335d95308
commit 03fc4b2e33
No known key found for this signature in database
GPG Key ID: C2F73508B56A193C
7 changed files with 8 additions and 8 deletions

View File

@ -559,7 +559,7 @@ module Json: sig
val convert : 'a Encoding.t -> 'a Json_encoding.encoding
(** Generate a schema from an {!encoding}. *)
val schema : 'a Encoding.t -> schema
val schema : ?definitions_path:string -> 'a Encoding.t -> schema
(** Construct a JSON object from an encoding. *)
val construct : 't Encoding.t -> 't -> json

View File

@ -296,7 +296,7 @@ include Json_encoding
let construct e v = construct (get_json e) v
let destruct e v = destruct (get_json e) v
let schema e = schema (get_json e)
let schema ?definitions_path e = schema ?definitions_path (get_json e)
let cannot_destruct fmt =
Format.kasprintf

View File

@ -37,7 +37,7 @@ type t = json
type schema = Json_schema.schema
val convert : 'a Encoding.t -> 'a Json_encoding.encoding
val schema : 'a Encoding.t -> schema
val schema : ?definitions_path:string -> 'a Encoding.t -> schema
val encoding: json Encoding.t
val schema_encoding: schema Encoding.t
val construct : 't Encoding.t -> 't -> json

View File

@ -220,7 +220,7 @@ val apply_lazy :
module Json : sig
val schema : 'a encoding -> json_schema
val schema : ?definitions_path:string -> 'a encoding -> json_schema
val construct : 't encoding -> 't -> json
val destruct : 't encoding -> json -> 't

View File

@ -28,8 +28,8 @@ type schema = Data_encoding.json_schema * Data_encoding.Binary_schema.t
let unit = Data_encoding.empty
let untyped = Data_encoding.(obj1 (req "untyped" string))
let conv f g t = Data_encoding.conv ~schema:(Data_encoding.Json.schema t) f g t
let schema t =
(Data_encoding.Json.schema t,
let schema ?definitions_path t =
(Data_encoding.Json.schema ?definitions_path t,
Data_encoding.Binary.describe t)
let schema_encoding =

View File

@ -539,7 +539,7 @@ module type ENCODING = sig
val unit : unit t
val untyped : string t
val conv : ('a -> 'b) -> ('b -> 'a) -> 'b t -> 'a t
val schema : 'a t -> schema
val schema : ?definitions_path:string -> 'a t -> schema
val description_request_encoding : Description.request t
val description_answer_encoding : schema Description.directory t
end

View File

@ -252,7 +252,7 @@ module type ENCODING = sig
val unit : unit t
val untyped : string t
val conv : ('a -> 'b) -> ('b -> 'a) -> 'b t -> 'a t
val schema : 'a t -> schema
val schema : ?definitions_path:string -> 'a t -> schema
val description_request_encoding : Description.request t
val description_answer_encoding : schema Description.directory t
end