···19192020module Unknown : sig
2121 type t = Jsont.json
2222- (** Unknown/unrecognized JSON object members as a generic JSON object.
2323- Useful for preserving fields from custom extensions or future spec versions. *)
2222+ (** Unknown/unrecognized JSON object members as a generic JSON object. Useful
2323+ for preserving fields from custom extensions or future spec versions. *)
24242525 val empty : t
2626 (** [empty] is the empty list of unknown fields. *)
+2-2
lib/author.mli
···18181919module Unknown : sig
2020 type t = Jsont.json
2121- (** Unknown/unrecognized JSON object members as a generic JSON object.
2222- Useful for preserving fields from custom extensions or future spec versions. *)
2121+ (** Unknown/unrecognized JSON object members as a generic JSON object. Useful
2222+ for preserving fields from custom extensions or future spec versions. *)
23232424 val empty : t
2525 (** [empty] is the empty list of unknown fields. *)
+2-2
lib/hub.mli
···18181919module Unknown : sig
2020 type t = Jsont.json
2121- (** Unknown/unrecognized JSON object members as a generic JSON object.
2222- Useful for preserving fields from custom extensions or future spec versions. *)
2121+ (** Unknown/unrecognized JSON object members as a generic JSON object. Useful
2222+ for preserving fields from custom extensions or future spec versions. *)
23232424 val empty : t
2525 (** [empty] is the empty list of unknown fields. *)
+1-3
lib/item.ml
···8383 | `Both (_, text) -> Some text
84848585let equal a b = a.id = b.id
8686-8787-let compare a b =
8888- Option.compare Ptime.compare a.date_published b.date_published
8686+let compare a b = Option.compare Ptime.compare a.date_published b.date_published
89879088let pp ppf t =
9189 match (t.date_published, t.title) with
+2-2
lib/item.mli
···28282929module Unknown : sig
3030 type t = Jsont.json
3131- (** Unknown/unrecognized JSON object members as a generic JSON object.
3232- Useful for preserving fields from custom extensions or future spec versions. *)
3131+ (** Unknown/unrecognized JSON object members as a generic JSON object. Useful
3232+ for preserving fields from custom extensions or future spec versions. *)
33333434 val empty : t
3535 (** [empty] is the empty list of unknown fields. *)
+2-2
lib/jsonfeed.ml
···167167 (List.iteri (fun i author ->
168168 if not (Author.is_valid author) then
169169 add_error
170170- (Printf.sprintf "feed author %d is invalid (needs at least one field)"
171171- i)))
170170+ (Printf.sprintf
171171+ "feed author %d is invalid (needs at least one field)" i)))
172172 feed.authors;
173173174174 (* Validate items *)
+2-1
lib/jsonfeed.mli
···1919module Unknown : sig
2020 type t = Jsont.json
2121 (** Unknown or unrecognized JSON object members as a generic JSON object.
2222- Useful for preserving fields from custom extensions or future spec versions. *)
2222+ Useful for preserving fields from custom extensions or future spec
2323+ versions. *)
23242425 val empty : t
2526 (** [empty] is the empty list of unknown fields. *)
+2-2
lib/reference.mli
···20202121module Unknown : sig
2222 type t = Jsont.json
2323- (** Unknown/unrecognized JSON object members as a generic JSON object.
2424- Useful for preserving fields from custom extensions or future spec versions. *)
2323+ (** Unknown/unrecognized JSON object members as a generic JSON object. Useful
2424+ for preserving fields from custom extensions or future spec versions. *)
25252626 val empty : t
2727 (** [empty] is the empty list of unknown fields. *)
+14-12
test/test_jsonfeed.ml
···384384 | Error e ->
385385 Alcotest.fail
386386 (Printf.sprintf "Parse failed: %s" (Jsont.Error.to_string e))
387387- | Ok author ->
387387+ | Ok author -> (
388388 (* Check that unknown fields are preserved *)
389389 let unknown = Author.unknown author in
390390 Alcotest.(check bool)
391391 "has unknown fields" false
392392 (Jsonfeed.Unknown.is_empty unknown);
393393 (* Encode and decode again *)
394394- (match Jsont_bytesrw.encode_string' Author.jsont author with
394394+ match Jsont_bytesrw.encode_string' Author.jsont author with
395395 | Error e ->
396396 Alcotest.fail
397397 (Printf.sprintf "Encode failed: %s" (Jsont.Error.to_string e))
···420420 | Error e ->
421421 Alcotest.fail
422422 (Printf.sprintf "Parse failed: %s" (Jsont.Error.to_string e))
423423- | Ok item ->
423423+ | Ok item -> (
424424 (* Check that unknown fields are preserved *)
425425 let unknown = Item.unknown item in
426426 Alcotest.(check bool)
427427 "has unknown fields" false
428428 (Jsonfeed.Unknown.is_empty unknown);
429429 (* Encode and decode again *)
430430- (match Jsont_bytesrw.encode_string' Item.jsont item with
430430+ match Jsont_bytesrw.encode_string' Item.jsont item with
431431 | Error e ->
432432 Alcotest.fail
433433 (Printf.sprintf "Encode failed: %s" (Jsont.Error.to_string e))
···456456 | Error e ->
457457 Alcotest.fail
458458 (Printf.sprintf "Parse failed: %s" (Jsont.Error.to_string e))
459459- | Ok feed ->
459459+ | Ok feed -> (
460460 (* Check that unknown fields are preserved *)
461461 let unknown = Jsonfeed.unknown feed in
462462 Alcotest.(check bool)
463463 "has unknown fields" false
464464 (Jsonfeed.Unknown.is_empty unknown);
465465 (* Encode and decode again *)
466466- (match Jsonfeed.to_string feed with
466466+ match Jsonfeed.to_string feed with
467467 | Error e ->
468468 Alcotest.fail
469469 (Printf.sprintf "Encode failed: %s" (Jsont.Error.to_string e))
···479479 (Jsonfeed.Unknown.is_empty unknown2)))
480480481481let test_hub_unknown_roundtrip () =
482482- let json = {|{
482482+ let json =
483483+ {|{
483484 "type": "WebSub",
484485 "url": "https://example.com/hub",
485486 "custom_field": "test"
486486- }|} in
487487+ }|}
488488+ in
487489 match Jsont_bytesrw.decode_string' Hub.jsont json with
488490 | Error e ->
489491 Alcotest.fail
490492 (Printf.sprintf "Parse failed: %s" (Jsont.Error.to_string e))
491491- | Ok hub ->
493493+ | Ok hub -> (
492494 let unknown = Hub.unknown hub in
493495 Alcotest.(check bool)
494496 "has unknown fields" false
495497 (Jsonfeed.Unknown.is_empty unknown);
496496- (match Jsont_bytesrw.encode_string' Hub.jsont hub with
498498+ match Jsont_bytesrw.encode_string' Hub.jsont hub with
497499 | Error e ->
498500 Alcotest.fail
499501 (Printf.sprintf "Encode failed: %s" (Jsont.Error.to_string e))
···520522 | Error e ->
521523 Alcotest.fail
522524 (Printf.sprintf "Parse failed: %s" (Jsont.Error.to_string e))
523523- | Ok att ->
525525+ | Ok att -> (
524526 let unknown = Attachment.unknown att in
525527 Alcotest.(check bool)
526528 "has unknown fields" false
527529 (Jsonfeed.Unknown.is_empty unknown);
528528- (match Jsont_bytesrw.encode_string' Attachment.jsont att with
530530+ match Jsont_bytesrw.encode_string' Attachment.jsont att with
529531 | Error e ->
530532 Alcotest.fail
531533 (Printf.sprintf "Encode failed: %s" (Jsont.Error.to_string e))