HTTP types: headers, status codes, methods, bodies, MIME types
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

json: rename mem -> member / finish -> seal across the codec + value API

Object combinators: [Object.mem] -> [Object.member], [Object.opt_mem]
-> [Object.opt_member], [Object.case_mem] -> [Object.case_member]. The
sibling submodules [Object.Mem] / [Object.Mems] become
[Object.Member] / [Object.Members]. RFC 8259 §4 calls these
"name/value pairs, referred to as the members", so mirror the spec
name rather than the shortened [mem].

[Object.finish] -> [Object.seal]. "Seal" reads as "close the map, no
more members added", which is what the operation does.

Value constructors/queries: [Value.mem] (function) -> [Value.member];
[Value.mem_find] -> [Value.member_key]; [Value.mem_names] ->
[Value.member_names]; [Value.mem_keys] -> [Value.member_keys].
[type mem = ...] -> [type member = ...]; [type object'] still points
at [member list].

Downstream (~80 files across slack, sbom, stripe, sigstore, requests,
claude, irmin, freebox) updated via perl-pie. dune build clean,
dune test ocaml-json clean.

+6 -6
+2 -2
dune-project
··· 14 14 (depends 15 15 (ocaml (>= 5.1)) 16 16 base64 17 - bytesrw 18 17 crypto-rng 19 18 cstruct 20 19 eio ··· 22 21 json logs 23 22 magic-mime 24 23 ptime 25 - uri)) 24 + uri 25 + loc))
+1 -1
http.opam
··· 9 9 "dune" {>= "3.21"} 10 10 "ocaml" {>= "5.1"} 11 11 "base64" 12 - "bytesrw" 13 12 "crypto-rng" 14 13 "cstruct" 15 14 "eio" ··· 19 18 "magic-mime" 20 19 "ptime" 21 20 "uri" 21 + "loc" 22 22 "odoc" {with-doc} 23 23 ] 24 24 build: [
+3 -3
test/test_body.ml
··· 89 89 (** {1 Body.json Tests} *) 90 90 91 91 let test_json_creates_json_body () = 92 - let body = Body.json (Json.string "hello") in 92 + let body = Body.json (Json.Value.string "hello") in 93 93 let ct = Body.content_type body in 94 94 match ct with 95 95 | Some mime -> ··· 98 98 | None -> Alcotest.fail "Expected Some content_type for json body" 99 99 100 100 let test_json_content () = 101 - let body = Body.json (Json.string "hello") in 101 + let body = Body.json (Json.Value.string "hello") in 102 102 let s = Body.Private.to_string body in 103 103 Alcotest.(check string) "json content" "\"hello\"" s 104 104 105 105 let test_json_not_empty () = 106 - let body = Body.json (Json.string "test") in 106 + let body = Body.json (Json.Value.string "test") in 107 107 Alcotest.(check bool) "json not empty" false (Body.Private.is_empty body) 108 108 109 109 (** {1 Body.is_empty Tests} *)