diff --git a/ocaml-protoc-plugin.opam b/ocaml-protoc-plugin.opam index fc45727..310200b 100644 --- a/ocaml-protoc-plugin.opam +++ b/ocaml-protoc-plugin.opam @@ -25,7 +25,7 @@ depends: [ "odoc" {with-doc} "conf-pkg-config" {build} "dune-configurator" {with-test} - "yojson" + "yojson" {with-test} "base64" "ptime" ] @@ -43,4 +43,8 @@ The types generated aims to create ocaml idiomatic types; - all integer types are mapped to int by default (exact mapping is also possible) - all floating point types are mapped to float. - packages are mapped to nested modules + +The package aims to be a 100% compliant protobuf implementation. +It also includes serializing to and from json (Yojson format) based on +protobuf json specification """ diff --git a/src/ocaml_protoc_plugin/deserialize_json.ml b/src/ocaml_protoc_plugin/deserialize_json.ml index 737b908..923ac29 100644 --- a/src/ocaml_protoc_plugin/deserialize_json.ml +++ b/src/ocaml_protoc_plugin/deserialize_json.ml @@ -3,10 +3,10 @@ open! StdLabels open Spec module FieldMap = Map.Make(String) -type fields = Yojson.Basic.t FieldMap.t +type fields = Json.t FieldMap.t let value_error type_name json = - Result.raise (`Wrong_field_type (type_name, Yojson.Basic.to_string json)) + Result.raise (`Wrong_field_type (type_name, Json.to_string json)) let to_int64 = function | `String s -> Int64.of_string s @@ -21,7 +21,7 @@ let to_string = function | `String s -> s | json -> value_error "string" json let to_bytes json = to_string json |> Base64.decode_exn |> Bytes.of_string -let to_enum: type a. (module Spec.Enum with type t = a) -> Yojson.Basic.t -> a = fun (module Enum) -> function +let to_enum: type a. (module Spec.Enum with type t = a) -> Json.t -> a = fun (module Enum) -> function | `String enum -> Enum.from_string_exn enum | `Int enum -> Enum.from_int_exn enum | json -> value_error "enum" json @@ -42,7 +42,7 @@ let to_list = function | `List l -> l | json -> value_error "list" json -let read_map: type a b. read_key:(string -> a) -> read_value:(Yojson.Basic.t -> b) -> Yojson.Basic.t -> (a * b) list = +let read_map: type a b. read_key:(string -> a) -> read_value:(Json.t -> b) -> Json.t -> (a * b) list = fun ~read_key ~read_value -> function | `Assoc entries -> List.map ~f:( fun (key, value) -> @@ -61,7 +61,7 @@ let duration_of_json json = (* must end with a 's' *) try - let s = Yojson.Basic.Util.to_string json in + let s = to_string json in assert (String.get s (String.length s - 1) = 's'); let sign, s = match String.get s 0 = '-' with | true -> (-1), String.sub s ~pos:1 ~len:(String.length s - 2) @@ -189,7 +189,7 @@ let value_to_json json = `Assoc [value] -let map_enum_json: (module Enum) -> Yojson.Basic.t -> Yojson.Basic.t = fun (module Enum) -> +let map_enum_json: (module Enum) -> Json.t -> Json.t = fun (module Enum) -> let name = Enum.name () |> String.split_on_char ~sep:'.' @@ -205,7 +205,7 @@ let map_enum_json: (module Enum) -> Yojson.Basic.t -> Yojson.Basic.t = fun (modu map | _ -> fun json -> json -let map_message_json: name:string -> Yojson.Basic.t -> Yojson.Basic.t = fun ~name -> +let map_message_json: name:string -> Json.t -> Json.t = fun ~name -> match name with | ".google.protobuf.Empty" (* Already mapped as it should I think *) -> fun json -> json @@ -272,7 +272,7 @@ let map_message_json: name:string -> Yojson.Basic.t -> Yojson.Basic.t = fun ~nam convert | _ -> fun json -> json -let read_value: type a b. (a, b) spec -> Yojson.Basic.t -> a = function +let read_value: type a b. (a, b) spec -> Json.t -> a = function | Double -> to_float | Float -> to_float | Int32 -> to_int32 @@ -402,7 +402,7 @@ let rec deserialize: type constr a. (constr, a) compound_list -> constr -> field cont (constr v) fields -let deserialize: type constr a. message_name:string -> (constr, a) compound_list -> constr -> Yojson.Basic.t -> a = +let deserialize: type constr a. message_name:string -> (constr, a) compound_list -> constr -> Json.t -> a = fun ~message_name spec constr -> let deserialize = deserialize spec constr in let map_message = map_message_json ~name:message_name in diff --git a/src/ocaml_protoc_plugin/deserialize_json.mli b/src/ocaml_protoc_plugin/deserialize_json.mli index 1ec9991..13ac8cd 100644 --- a/src/ocaml_protoc_plugin/deserialize_json.mli +++ b/src/ocaml_protoc_plugin/deserialize_json.mli @@ -1,13 +1,12 @@ -val deserialize: message_name:string -> ('constr, 'a) Spec.compound_list -> 'constr -> Yojson.Basic.t -> 'a +val deserialize: message_name:string -> ('constr, 'a) Spec.compound_list -> 'constr -> Json.t -> 'a (**) -val to_int64: Yojson.Basic.t -> int64 -val to_int32: Yojson.Basic.t -> int32 -val to_int: Yojson.Basic.t -> int -val to_string: Yojson.Basic.t -> string -val to_bytes: Yojson.Basic.t -> bytes -val to_float: Yojson.Basic.t -> float -val to_bool: Yojson.Basic.t -> bool -val to_list: Yojson.Basic.t -> Yojson.Basic.t list - +val to_int64: Json.t -> int64 +val to_int32: Json.t -> int32 +val to_int: Json.t -> int +val to_string: Json.t -> string +val to_bytes: Json.t -> bytes +val to_float: Json.t -> float +val to_bool: Json.t -> bool +val to_list: Json.t -> Json.t list (**) diff --git a/src/ocaml_protoc_plugin/dune b/src/ocaml_protoc_plugin/dune index 4fb7a82..67b90f7 100644 --- a/src/ocaml_protoc_plugin/dune +++ b/src/ocaml_protoc_plugin/dune @@ -3,7 +3,7 @@ (public_name ocaml-protoc-plugin) (synopsis "Serialization and deserialization of protobuf types") (inline_tests) - (libraries yojson base64 ptime) + (libraries base64 ptime) (preprocess (pps ppx_expect)) (instrumentation (backend bisect_ppx)) ) diff --git a/src/ocaml_protoc_plugin/json.ml b/src/ocaml_protoc_plugin/json.ml new file mode 100644 index 0000000..198b732 --- /dev/null +++ b/src/ocaml_protoc_plugin/json.ml @@ -0,0 +1,25 @@ +open StdLabels + +(** Json type. This is identical to Yojson.Basic.t *) +type t = [ + | `Null + | `Bool of bool + | `Int of int + | `Float of float + | `String of string + | `Assoc of (string * t) list + | `List of t list +] + +let rec to_string = function + | `Null -> "null" + | `Bool b -> string_of_bool b + | `Int i -> string_of_int i + | `Float f -> string_of_float f + | `String s -> Printf.sprintf "\"%s\"" s + | `Assoc l -> List.map ~f:(fun (key, value) -> Printf.sprintf "\"%s\": %s" key (to_string value)) l + |> String.concat ~sep:", " + |> Printf.sprintf "{ %s }" + | `List l -> List.map ~f:to_string l + |> String.concat ~sep:", " + |> Printf.sprintf "[ %s ]" diff --git a/src/ocaml_protoc_plugin/ocaml_protoc_plugin.ml b/src/ocaml_protoc_plugin/ocaml_protoc_plugin.ml index 4f3699b..a6a4674 100644 --- a/src/ocaml_protoc_plugin/ocaml_protoc_plugin.ml +++ b/src/ocaml_protoc_plugin/ocaml_protoc_plugin.ml @@ -1,4 +1,5 @@ (**/**) + module Serialize = Serialize module Deserialize = Deserialize module Serialize_json = Serialize_json @@ -8,6 +9,7 @@ module Field = Field module Merge = Merge (**/**) +module Json = Json module Reader = Reader module Writer = Writer module Service = Service diff --git a/src/ocaml_protoc_plugin/serialize_json.ml b/src/ocaml_protoc_plugin/serialize_json.ml index c33aea7..6bf9958 100644 --- a/src/ocaml_protoc_plugin/serialize_json.ml +++ b/src/ocaml_protoc_plugin/serialize_json.ml @@ -3,9 +3,9 @@ open Spec (** Serialize to json as per https://protobuf.dev/programming-guides/proto3/#json-options *) let value_error type_name json = - Result.raise (`Wrong_field_type (type_name, Yojson.Basic.show json)) + Result.raise (`Wrong_field_type (type_name, Json.to_string json)) -type field = string * Yojson.Basic.t +type field = string * Json.t let int32_value v = `Int (Int32.to_int v) let int32_int_value v = `Int v @@ -26,7 +26,7 @@ let key_to_string = function | `String s -> s | `Bool b -> string_of_bool b | `Int v -> string_of_int v - | json -> Result.raise (`Wrong_field_type ("map key", (Yojson.Basic.to_string json))) + | json -> Result.raise (`Wrong_field_type ("map key", (Json.to_string json))) let key ~json_names (_, name, json_name) = match json_names with @@ -82,7 +82,7 @@ let duration_to_json json = let%expect_test "duration_to_json" = let test seconds nanos = let json = `Assoc ["seconds", `Int seconds; "nanos", `Int nanos] in - Printf.printf "%d.%d -> %s\n" seconds nanos (Yojson.Basic.to_string (duration_to_json json)) + Printf.printf "%d.%d -> %s\n" seconds nanos (Json.to_string (duration_to_json json)) in test 100 0; test (1000) (123456); @@ -117,7 +117,7 @@ let timestamp_to_json json = let%expect_test "timestamp_to_json" = let test seconds nanos = let json = `Assoc ["seconds", `Int seconds; "nanos", `Int nanos] in - Printf.printf "%d.%d -> %s\n" seconds nanos (Yojson.Basic.to_string (timestamp_to_json json)) + Printf.printf "%d.%d -> %s\n" seconds nanos (Json.to_string (timestamp_to_json json)) in test 1709931283 0; test 1709931283 (1_000_000_002/2); @@ -132,7 +132,7 @@ let%expect_test "timestamp_to_json" = let wrapper_to_json json = get_key ~f:(fun id -> id) ~default:`Null "value" json -let map_enum_json: (module Enum) -> Yojson.Basic.t -> Yojson.Basic.t = fun (module Enum) -> +let map_enum_json: (module Enum) -> Json.t -> Json.t = fun (module Enum) -> let name = Enum.name () |> String.split_on_char ~sep:'.' @@ -150,7 +150,7 @@ let map_enum_json: (module Enum) -> Yojson.Basic.t -> Yojson.Basic.t = fun (modu (* Convert already emitted json based on json mappings *) -let map_message_json: name:string -> (Yojson.Basic.t -> Yojson.Basic.t) option = fun ~name -> +let map_message_json: name:string -> (Json.t -> Json.t) option = fun ~name -> match name with | ".google.protobuf.Empty" -> Some (fun json -> json) @@ -204,7 +204,7 @@ let map_message_json: name:string -> (Yojson.Basic.t -> Yojson.Basic.t) option = Some map | _ -> None -let rec json_of_spec: type a b. Json_options.t -> (a, b) spec -> a -> Yojson.Basic.t = +let rec json_of_spec: type a b. Json_options.t -> (a, b) spec -> a -> Json.t = fun options -> function | Double -> float_value | Float -> float_value @@ -315,13 +315,13 @@ and write: type a b. Json_options.t -> (a, b) compound -> a -> field list = fun f v end -let serialize: type a. message_name:string -> Json_options.t -> (a, Yojson.Basic.t) compound_list -> field list -> a = fun ~message_name options -> +let serialize: type a. message_name:string -> Json_options.t -> (a, Json.t) compound_list -> field list -> a = fun ~message_name options -> let omit_default_values, map_result = match map_message_json ~name:message_name with | Some mapping -> false, fun json -> `Assoc (List.rev json) |> mapping | None -> options.omit_default_values, fun json -> `Assoc (List.rev json) in let options = { options with omit_default_values } in - let rec inner: type a. (a, Yojson.Basic.t) compound_list -> field list -> a = + let rec inner: type a. (a, Json.t) compound_list -> field list -> a = function | Nil -> map_result | Nil_ext _extension_ranges -> fun json _extensions -> map_result json @@ -334,7 +334,7 @@ let serialize: type a. message_name:string -> Json_options.t -> (a, Yojson.Basic in inner -let serialize: type a. message_name:string -> (a, Yojson.Basic.t) compound_list -> Json_options.t -> a = +let serialize: type a. message_name:string -> (a, Json.t) compound_list -> Json_options.t -> a = fun ~message_name spec -> let arr = Array.init (Json_options.max_int + 1) ~f:(fun i -> Lazy.from_fun (fun () -> serialize ~message_name (Json_options.of_int i) spec [])) in fun options -> diff --git a/src/ocaml_protoc_plugin/serialize_json.mli b/src/ocaml_protoc_plugin/serialize_json.mli index 0ca0fdb..fa09b9f 100644 --- a/src/ocaml_protoc_plugin/serialize_json.mli +++ b/src/ocaml_protoc_plugin/serialize_json.mli @@ -1,2 +1,2 @@ -val serialize: message_name:string -> ('a, Yojson.Basic.t) Spec.compound_list -> Json_options.t -> 'a +val serialize: message_name:string -> ('a, Json.t) Spec.compound_list -> Json_options.t -> 'a diff --git a/src/ocaml_protoc_plugin/spec.ml b/src/ocaml_protoc_plugin/spec.ml index 613f703..5cfc455 100644 --- a/src/ocaml_protoc_plugin/spec.ml +++ b/src/ocaml_protoc_plugin/spec.ml @@ -24,9 +24,9 @@ module type Message = sig val to_proto: t -> Writer.t val to_proto': Writer.t -> t -> unit val merge: t -> t -> t - val to_json: Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> t Result.t + val to_json: Json_options.t -> t -> Json.t + val from_json_exn: Json.t -> t + val from_json: Json.t -> t Result.t end module Make(T : T) = struct diff --git a/src/plugin/emit.ml b/src/plugin/emit.ml index 4b1fad1..86040d0 100644 --- a/src/plugin/emit.ml +++ b/src/plugin/emit.ml @@ -261,9 +261,9 @@ let rec emit_message ~params ~syntax ~scope Code.emit signature `None "val to_proto: t -> Runtime'.Writer.t"; Code.emit signature `None "val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result"; Code.emit signature `None "val from_proto_exn: Runtime'.Reader.t -> t"; - Code.emit signature `None "val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t"; - Code.emit signature `None "val from_json_exn: Yojson.Basic.t -> t"; - Code.emit signature `None "val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result"; + Code.emit signature `None "val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t"; + Code.emit signature `None "val from_json_exn: Runtime'.Json.t -> t"; + Code.emit signature `None "val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result"; Code.emit implementation `None "let name () = \"%s\"" (Scope.get_proto_path scope); Code.emit implementation `None "type t = %s%s" type' params.annot; diff --git a/src/spec/descriptor.ml b/src/spec/descriptor.ml index f9c830b..b694438 100644 --- a/src/spec/descriptor.ml +++ b/src/spec/descriptor.ml @@ -35,9 +35,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FileDescriptorProto : sig val name: unit -> string @@ -48,9 +48,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and DescriptorProto : sig module rec ExtensionRange : sig @@ -62,9 +62,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ReservedRange : sig val name: unit -> string @@ -75,9 +75,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: string option; field: FieldDescriptorProto.t list; nested_type: DescriptorProto.t list; enum_type: EnumDescriptorProto.t list; extension_range: ExtensionRange.t list; extension: FieldDescriptorProto.t list; options: MessageOptions.t option; oneof_decl: OneofDescriptorProto.t list; reserved_range: ReservedRange.t list; reserved_name: string list } @@ -87,9 +87,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ExtensionRangeOptions : sig val name: unit -> string @@ -100,9 +100,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FieldDescriptorProto : sig module rec Type : sig @@ -131,9 +131,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and OneofDescriptorProto : sig val name: unit -> string @@ -144,9 +144,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumDescriptorProto : sig module rec EnumReservedRange : sig @@ -158,9 +158,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: string option; value: EnumValueDescriptorProto.t list; options: EnumOptions.t option; reserved_range: EnumReservedRange.t list; reserved_name: string list } @@ -170,9 +170,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumValueDescriptorProto : sig val name: unit -> string @@ -183,9 +183,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ServiceDescriptorProto : sig val name: unit -> string @@ -196,9 +196,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and MethodDescriptorProto : sig val name: unit -> string @@ -209,9 +209,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FileOptions : sig module rec OptimizeMode : sig @@ -231,9 +231,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and MessageOptions : sig val name: unit -> string @@ -244,9 +244,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FieldOptions : sig module rec CType : sig @@ -275,9 +275,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and OneofOptions : sig val name: unit -> string @@ -288,9 +288,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumOptions : sig val name: unit -> string @@ -301,9 +301,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumValueOptions : sig val name: unit -> string @@ -314,9 +314,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ServiceOptions : sig val name: unit -> string @@ -327,9 +327,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and MethodOptions : sig module rec IdempotencyLevel : sig @@ -349,9 +349,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and UninterpretedOption : sig module rec NamePart : sig @@ -363,9 +363,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: NamePart.t list; identifier_value: string option; positive_int_value: int option; negative_int_value: int option; double_value: float option; string_value: bytes option; aggregate_value: string option } @@ -375,9 +375,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and SourceCodeInfo : sig module rec Location : sig @@ -389,9 +389,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = (Location.t list) @@ -401,9 +401,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and GeneratedCodeInfo : sig module rec Annotation : sig @@ -415,9 +415,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = (Annotation.t list) @@ -427,9 +427,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end end end = struct @@ -443,9 +443,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FileDescriptorProto : sig val name: unit -> string @@ -456,9 +456,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and DescriptorProto : sig module rec ExtensionRange : sig @@ -470,9 +470,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ReservedRange : sig val name: unit -> string @@ -483,9 +483,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: string option; field: FieldDescriptorProto.t list; nested_type: DescriptorProto.t list; enum_type: EnumDescriptorProto.t list; extension_range: ExtensionRange.t list; extension: FieldDescriptorProto.t list; options: MessageOptions.t option; oneof_decl: OneofDescriptorProto.t list; reserved_range: ReservedRange.t list; reserved_name: string list } @@ -495,9 +495,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ExtensionRangeOptions : sig val name: unit -> string @@ -508,9 +508,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FieldDescriptorProto : sig module rec Type : sig @@ -539,9 +539,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and OneofDescriptorProto : sig val name: unit -> string @@ -552,9 +552,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumDescriptorProto : sig module rec EnumReservedRange : sig @@ -566,9 +566,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: string option; value: EnumValueDescriptorProto.t list; options: EnumOptions.t option; reserved_range: EnumReservedRange.t list; reserved_name: string list } @@ -578,9 +578,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumValueDescriptorProto : sig val name: unit -> string @@ -591,9 +591,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ServiceDescriptorProto : sig val name: unit -> string @@ -604,9 +604,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and MethodDescriptorProto : sig val name: unit -> string @@ -617,9 +617,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FileOptions : sig module rec OptimizeMode : sig @@ -639,9 +639,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and MessageOptions : sig val name: unit -> string @@ -652,9 +652,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and FieldOptions : sig module rec CType : sig @@ -683,9 +683,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and OneofOptions : sig val name: unit -> string @@ -696,9 +696,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumOptions : sig val name: unit -> string @@ -709,9 +709,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and EnumValueOptions : sig val name: unit -> string @@ -722,9 +722,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ServiceOptions : sig val name: unit -> string @@ -735,9 +735,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and MethodOptions : sig module rec IdempotencyLevel : sig @@ -757,9 +757,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and UninterpretedOption : sig module rec NamePart : sig @@ -771,9 +771,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: NamePart.t list; identifier_value: string option; positive_int_value: int option; negative_int_value: int option; double_value: float option; string_value: bytes option; aggregate_value: string option } @@ -783,9 +783,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and SourceCodeInfo : sig module rec Location : sig @@ -797,9 +797,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = (Location.t list) @@ -809,9 +809,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and GeneratedCodeInfo : sig module rec Annotation : sig @@ -823,9 +823,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = (Annotation.t list) @@ -835,9 +835,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end end = struct module rec FileDescriptorSet : sig @@ -849,9 +849,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.FileDescriptorSet" type t = (FileDescriptorProto.t list) @@ -886,9 +886,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.FileDescriptorProto" type t = { name: string option; package: string option; dependency: string list; message_type: DescriptorProto.t list; enum_type: EnumDescriptorProto.t list; service: ServiceDescriptorProto.t list; extension: FieldDescriptorProto.t list; options: FileOptions.t option; source_code_info: SourceCodeInfo.t option; public_dependency: int list; weak_dependency: int list; syntax: string option } @@ -948,9 +948,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and ReservedRange : sig val name: unit -> string @@ -961,9 +961,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: string option; field: FieldDescriptorProto.t list; nested_type: DescriptorProto.t list; enum_type: EnumDescriptorProto.t list; extension_range: ExtensionRange.t list; extension: FieldDescriptorProto.t list; options: MessageOptions.t option; oneof_decl: OneofDescriptorProto.t list; reserved_range: ReservedRange.t list; reserved_name: string list } @@ -973,9 +973,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec ExtensionRange : sig val name: unit -> string @@ -986,9 +986,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.DescriptorProto.ExtensionRange" type t = { start: int option; end': int option; options: ExtensionRangeOptions.t option } @@ -1029,9 +1029,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.DescriptorProto.ReservedRange" type t = { start: int option; end': int option } @@ -1114,9 +1114,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.ExtensionRangeOptions" type t = { uninterpreted_option: UninterpretedOption.t list; extensions': Runtime'.Extensions.t } @@ -1172,9 +1172,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec Type : sig type t = TYPE_DOUBLE | TYPE_FLOAT | TYPE_INT64 | TYPE_UINT64 | TYPE_INT32 | TYPE_FIXED64 | TYPE_FIXED32 | TYPE_BOOL | TYPE_STRING | TYPE_GROUP | TYPE_MESSAGE | TYPE_BYTES | TYPE_UINT32 | TYPE_ENUM | TYPE_SFIXED32 | TYPE_SFIXED64 | TYPE_SINT32 | TYPE_SINT64 @@ -1355,9 +1355,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.OneofDescriptorProto" type t = { name: string option; options: OneofOptions.t option } @@ -1397,9 +1397,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: string option; value: EnumValueDescriptorProto.t list; options: EnumOptions.t option; reserved_range: EnumReservedRange.t list; reserved_name: string list } @@ -1409,9 +1409,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec EnumReservedRange : sig val name: unit -> string @@ -1422,9 +1422,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.EnumDescriptorProto.EnumReservedRange" type t = { start: int option; end': int option } @@ -1497,9 +1497,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.EnumValueDescriptorProto" type t = { name: string option; number: int option; options: EnumValueOptions.t option } @@ -1540,9 +1540,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.ServiceDescriptorProto" type t = { name: string option; method': MethodDescriptorProto.t list; options: ServiceOptions.t option } @@ -1583,9 +1583,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.MethodDescriptorProto" type t = { name: string option; input_type: string option; output_type: string option; options: MethodOptions.t option; client_streaming: bool; server_streaming: bool } @@ -1641,9 +1641,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec OptimizeMode : sig type t = SPEED | CODE_SIZE | LITE_RUNTIME @@ -1753,9 +1753,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.MessageOptions" type t = { message_set_wire_format: bool; no_standard_descriptor_accessor: bool; deprecated: bool; map_entry: bool option; uninterpreted_option: UninterpretedOption.t list; extensions': Runtime'.Extensions.t } @@ -1819,9 +1819,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec CType : sig type t = STRING | CORD | STRING_PIECE @@ -1937,9 +1937,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.OneofOptions" type t = { uninterpreted_option: UninterpretedOption.t list; extensions': Runtime'.Extensions.t } @@ -1977,9 +1977,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.EnumOptions" type t = { allow_alias: bool option; deprecated: bool; uninterpreted_option: UninterpretedOption.t list; extensions': Runtime'.Extensions.t } @@ -2021,9 +2021,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.EnumValueOptions" type t = { deprecated: bool; uninterpreted_option: UninterpretedOption.t list; extensions': Runtime'.Extensions.t } @@ -2063,9 +2063,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.ServiceOptions" type t = { deprecated: bool; uninterpreted_option: UninterpretedOption.t list; extensions': Runtime'.Extensions.t } @@ -2114,9 +2114,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec IdempotencyLevel : sig type t = IDEMPOTENCY_UNKNOWN | NO_SIDE_EFFECTS | IDEMPOTENT @@ -2191,9 +2191,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { name: NamePart.t list; identifier_value: string option; positive_int_value: int option; negative_int_value: int option; double_value: float option; string_value: bytes option; aggregate_value: string option } @@ -2203,9 +2203,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec NamePart : sig val name: unit -> string @@ -2216,9 +2216,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.UninterpretedOption.NamePart" type t = { name_part: string; is_extension: bool } @@ -2296,9 +2296,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = (Location.t list) @@ -2308,9 +2308,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec Location : sig val name: unit -> string @@ -2321,9 +2321,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.SourceCodeInfo.Location" type t = { path: int list; span: int list; leading_comments: string option; trailing_comments: string option; leading_detached_comments: string list } @@ -2393,9 +2393,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = (Annotation.t list) @@ -2405,9 +2405,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec Annotation : sig val name: unit -> string @@ -2418,9 +2418,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.GeneratedCodeInfo.Annotation" type t = { path: int list; source_file: string option; begin': int option; end': int option } diff --git a/src/spec/options.ml b/src/spec/options.ml index 5fd039f..3a09a3e 100644 --- a/src/spec/options.ml +++ b/src/spec/options.ml @@ -34,9 +34,9 @@ module rec Options : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".Options" type t = (bool) diff --git a/src/spec/plugin.ml b/src/spec/plugin.ml index fa3c102..9c1e4c4 100644 --- a/src/spec/plugin.ml +++ b/src/spec/plugin.ml @@ -37,9 +37,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and CodeGeneratorRequest : sig val name: unit -> string @@ -50,9 +50,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and CodeGeneratorResponse : sig module rec Feature : sig @@ -73,9 +73,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { error: string option; supported_features: int option; file: File.t list } @@ -85,9 +85,9 @@ module rec Google : sig val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end end end @@ -103,9 +103,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and CodeGeneratorRequest : sig val name: unit -> string @@ -116,9 +116,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and CodeGeneratorResponse : sig module rec Feature : sig @@ -139,9 +139,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { error: string option; supported_features: int option; file: File.t list } @@ -151,9 +151,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end end end = struct @@ -167,9 +167,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and CodeGeneratorRequest : sig val name: unit -> string @@ -180,9 +180,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end and CodeGeneratorResponse : sig module rec Feature : sig @@ -203,9 +203,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { error: string option; supported_features: int option; file: File.t list } @@ -215,9 +215,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end end = struct module rec Version : sig @@ -229,9 +229,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.compiler.Version" type t = { major: int option; minor: int option; patch: int option; suffix: string option } @@ -274,9 +274,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.compiler.CodeGeneratorRequest" type t = { file_to_generate: string list; parameter: string option; compiler_version: Version.t option; proto_file: Imported'modules.Descriptor.Google.Protobuf.FileDescriptorProto.t list } @@ -329,9 +329,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end val name: unit -> string type t = { error: string option; supported_features: int option; file: File.t list } @@ -341,9 +341,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct module rec Feature : sig type t = FEATURE_NONE | FEATURE_PROTO3_OPTIONAL @@ -382,9 +382,9 @@ end = struct val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t - val to_json: Runtime'.Json_options.t -> t -> Yojson.Basic.t - val from_json_exn: Yojson.Basic.t -> t - val from_json: Yojson.Basic.t -> (t, [> Runtime'.Result.error]) result + val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t + val from_json_exn: Runtime'.Json.t -> t + val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result end = struct let name () = ".google.protobuf.compiler.CodeGeneratorResponse.File" type t = { name: string option; insertion_point: string option; content: string option; generated_code_info: Imported'modules.Descriptor.Google.Protobuf.GeneratedCodeInfo.t option }