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