2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
2018-05-03 09:52:30 +04:00
|
|
|
module Encoding =
|
|
|
|
struct
|
2018-05-03 08:27:17 +04:00
|
|
|
include Encoding
|
|
|
|
let splitted ~json ~binary = raw_splitted ~json:(Json.convert json) ~binary
|
2016-09-09 19:02:43 +04:00
|
|
|
let assoc enc =
|
2018-05-03 08:27:17 +04:00
|
|
|
let json = Json_encoding.assoc (Json.convert enc) in
|
2016-09-09 19:02:43 +04:00
|
|
|
let binary = list (tup2 string enc) in
|
|
|
|
raw_splitted ~json ~binary
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
include Encoding
|
|
|
|
|
2018-05-03 09:52:30 +04:00
|
|
|
module Json = Json
|
|
|
|
module Bson = Bson
|
|
|
|
module Binary = Binary
|
2018-05-03 08:27:17 +04:00
|
|
|
|
|
|
|
type json = Json.t
|
|
|
|
let json = Json.encoding
|
|
|
|
type json_schema = Json.schema
|
|
|
|
let json_schema = Json.schema_encoding
|
|
|
|
type bson = Bson.t
|