fixup 242c97d1
ocplib-json-types: 'Variable defintion path in json_schema'
This commit is contained in:
parent
7335d95308
commit
03fc4b2e33
@ -559,7 +559,7 @@ module Json: sig
|
|||||||
val convert : 'a Encoding.t -> 'a Json_encoding.encoding
|
val convert : 'a Encoding.t -> 'a Json_encoding.encoding
|
||||||
|
|
||||||
(** Generate a schema from an {!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. *)
|
(** Construct a JSON object from an encoding. *)
|
||||||
val construct : 't Encoding.t -> 't -> json
|
val construct : 't Encoding.t -> 't -> json
|
||||||
|
@ -296,7 +296,7 @@ include Json_encoding
|
|||||||
|
|
||||||
let construct e v = construct (get_json e) v
|
let construct e v = construct (get_json e) v
|
||||||
let destruct e v = destruct (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 =
|
let cannot_destruct fmt =
|
||||||
Format.kasprintf
|
Format.kasprintf
|
||||||
|
@ -37,7 +37,7 @@ type t = json
|
|||||||
type schema = Json_schema.schema
|
type schema = Json_schema.schema
|
||||||
|
|
||||||
val convert : 'a Encoding.t -> 'a Json_encoding.encoding
|
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 encoding: json Encoding.t
|
||||||
val schema_encoding: schema Encoding.t
|
val schema_encoding: schema Encoding.t
|
||||||
val construct : 't Encoding.t -> 't -> json
|
val construct : 't Encoding.t -> 't -> json
|
||||||
|
@ -220,7 +220,7 @@ val apply_lazy :
|
|||||||
|
|
||||||
module Json : sig
|
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 construct : 't encoding -> 't -> json
|
||||||
val destruct : 't encoding -> json -> 't
|
val destruct : 't encoding -> json -> 't
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ type schema = Data_encoding.json_schema * Data_encoding.Binary_schema.t
|
|||||||
let unit = Data_encoding.empty
|
let unit = Data_encoding.empty
|
||||||
let untyped = Data_encoding.(obj1 (req "untyped" string))
|
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 conv f g t = Data_encoding.conv ~schema:(Data_encoding.Json.schema t) f g t
|
||||||
let schema t =
|
let schema ?definitions_path t =
|
||||||
(Data_encoding.Json.schema t,
|
(Data_encoding.Json.schema ?definitions_path t,
|
||||||
Data_encoding.Binary.describe t)
|
Data_encoding.Binary.describe t)
|
||||||
|
|
||||||
let schema_encoding =
|
let schema_encoding =
|
||||||
|
2
vendors/ocplib-resto/lib_resto/resto.ml
vendored
2
vendors/ocplib-resto/lib_resto/resto.ml
vendored
@ -539,7 +539,7 @@ module type ENCODING = sig
|
|||||||
val unit : unit t
|
val unit : unit t
|
||||||
val untyped : string t
|
val untyped : string t
|
||||||
val conv : ('a -> 'b) -> ('b -> 'a) -> 'b t -> 'a 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_request_encoding : Description.request t
|
||||||
val description_answer_encoding : schema Description.directory t
|
val description_answer_encoding : schema Description.directory t
|
||||||
end
|
end
|
||||||
|
2
vendors/ocplib-resto/lib_resto/resto.mli
vendored
2
vendors/ocplib-resto/lib_resto/resto.mli
vendored
@ -252,7 +252,7 @@ module type ENCODING = sig
|
|||||||
val unit : unit t
|
val unit : unit t
|
||||||
val untyped : string t
|
val untyped : string t
|
||||||
val conv : ('a -> 'b) -> ('b -> 'a) -> 'b t -> 'a 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_request_encoding : Description.request t
|
||||||
val description_answer_encoding : schema Description.directory t
|
val description_answer_encoding : schema Description.directory t
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user