Doc: less unnamed fields in binary description
This commit is contained in:
parent
5baa090a1e
commit
c82b44e8f2
@ -54,7 +54,10 @@ let encoding =
|
|||||||
let open Data_encoding in
|
let open Data_encoding in
|
||||||
def "fitness"
|
def "fitness"
|
||||||
~title: "Fitness"
|
~title: "Fitness"
|
||||||
~description: "... FIXME ..."
|
~description: "... FIXME ..." @@
|
||||||
|
splitted
|
||||||
|
~json: (list bytes)
|
||||||
|
~binary:
|
||||||
(list (def "fitness.elem" bytes))
|
(list (def "fitness.elem" bytes))
|
||||||
|
|
||||||
let to_bytes v = Data_encoding.Binary.to_bytes_exn encoding v
|
let to_bytes v = Data_encoding.Binary.to_bytes_exn encoding v
|
||||||
|
@ -101,7 +101,7 @@ module MakeEncoder(H : sig
|
|||||||
let open Data_encoding in
|
let open Data_encoding in
|
||||||
splitted
|
splitted
|
||||||
~binary:
|
~binary:
|
||||||
H.raw_encoding
|
(obj1 (req H.name H.raw_encoding))
|
||||||
~json:
|
~json:
|
||||||
(def H.name
|
(def H.name
|
||||||
~title: (H.title ^ " (Base58Check-encoded)") @@
|
~title: (H.title ^ " (Base58Check-encoded)") @@
|
||||||
|
@ -215,8 +215,8 @@ let describe (type x) (encoding : x Encoding.t) =
|
|||||||
and obj fields =
|
and obj fields =
|
||||||
Binary_schema.Obj { fields }
|
Binary_schema.Obj { fields }
|
||||||
and union :
|
and union :
|
||||||
type a. recursives -> references -> Kind.t -> Binary_size.tag_size -> a case list -> string * references=
|
type a. string option -> recursives -> references -> Kind.t -> Binary_size.tag_size -> a case list -> string * references=
|
||||||
fun recursives references kind size cases ->
|
fun ref_name recursives references kind size cases ->
|
||||||
let cases =
|
let cases =
|
||||||
List.sort (fun (t1, _) (t2, _) -> Compare.Int.compare t1 t2) @@
|
List.sort (fun (t1, _) (t2, _) -> Compare.Int.compare t1 t2) @@
|
||||||
TzList.filter_map
|
TzList.filter_map
|
||||||
@ -233,7 +233,7 @@ let describe (type x) (encoding : x Encoding.t) =
|
|||||||
((tag, Some case.title, tag_field :: fields) :: cases, references))
|
((tag, Some case.title, tag_field :: fields) :: cases, references))
|
||||||
cases
|
cases
|
||||||
([], references) in
|
([], references) in
|
||||||
let name = new_reference () in
|
let name = may_new_reference ref_name in
|
||||||
let references =
|
let references =
|
||||||
add_reference
|
add_reference
|
||||||
name
|
name
|
||||||
@ -327,7 +327,7 @@ let describe (type x) (encoding : x Encoding.t) =
|
|||||||
fields None recursives references right.encoding in
|
fields None recursives references right.encoding in
|
||||||
(fields1 @ fields2, references)
|
(fields1 @ fields2, references)
|
||||||
| Union { kind ; tag_size ; cases } ->
|
| Union { kind ; tag_size ; cases } ->
|
||||||
let name, references = union recursives references kind tag_size cases in
|
let name, references = union None recursives references kind tag_size cases in
|
||||||
([ Anonymous_field (kind, Ref name) ], references)
|
([ Anonymous_field (kind, Ref name) ], references)
|
||||||
| (Mu { kind ; name ; title ; description ; fix } as encoding) ->
|
| (Mu { kind ; name ; title ; description ; fix } as encoding) ->
|
||||||
let kind = (kind :> Kind.t) in
|
let kind = (kind :> Kind.t) in
|
||||||
@ -459,8 +459,7 @@ let describe (type x) (encoding : x Encoding.t) =
|
|||||||
let references = add_reference name (obj fields) references in
|
let references = add_reference name (obj fields) references in
|
||||||
(Ref name, references)
|
(Ref name, references)
|
||||||
| Union { kind ; tag_size ; cases } ->
|
| Union { kind ; tag_size ; cases } ->
|
||||||
(* FIXMe ref_name ?? *)
|
let name, references = union ref_name recursives references kind tag_size cases in
|
||||||
let name, references = union recursives references kind tag_size cases in
|
|
||||||
(Ref name, references)
|
(Ref name, references)
|
||||||
| Mu { name ; title ; description ; fix } as encoding ->
|
| Mu { name ; title ; description ; fix } as encoding ->
|
||||||
let title = Option.unopt ~default:name title in
|
let title = Option.unopt ~default:name title in
|
||||||
|
@ -335,6 +335,7 @@ module Encoding = struct
|
|||||||
| Single o -> o in
|
| Single o -> o in
|
||||||
let of_list : Kind.endorsements contents -> _ = function
|
let of_list : Kind.endorsements contents -> _ = function
|
||||||
| o -> Single o in
|
| o -> Single o in
|
||||||
|
def "inlined.endorsement" @@
|
||||||
conv
|
conv
|
||||||
(fun ({ shell ; protocol_data = { contents ; signature } } : _ operation)->
|
(fun ({ shell ; protocol_data = { contents ; signature } } : _ operation)->
|
||||||
(shell, (contents, signature)))
|
(shell, (contents, signature)))
|
||||||
@ -345,6 +346,7 @@ module Encoding = struct
|
|||||||
(obj2
|
(obj2
|
||||||
(req "operations"
|
(req "operations"
|
||||||
(conv to_list of_list @@
|
(conv to_list of_list @@
|
||||||
|
def "inlined.endorsement.contents" @@
|
||||||
union [
|
union [
|
||||||
make endorsement_case ;
|
make endorsement_case ;
|
||||||
]))
|
]))
|
||||||
|
Loading…
Reference in New Issue
Block a user