nox-jsonfeed#
Warning. This is a work-in-progress experimental fork of ocaml-jsonfeed. Do not use it in production; use ocaml-jsonfeed instead.
Type-safe parsing and serialization of the JSON Feed 1.1 syndication format -- a JSON alternative to RSS and Atom. Each feed object (feed, item, author, attachment, hub) is a typed OCaml record with a declarative nox-json codec that preserves unknown extension members across a decode/encode round-trip.
Overview#
nox-jsonfeed is a fork of
@anil.recoil.org/ocaml-jsonfeed
with the jsont codec replaced by
nox-json, and its I/O surface aligned to the monorepo encoding
conventions (of_string / of_reader / to_string / to_writer, each with an
_exn twin).
Usage#
$ opam install nox-jsonfeed
let roundtrip s =
match Jsonfeed.of_string s with
| Error e -> Error (Jsonfeed.Json.Error.to_string e)
| Ok feed -> Ok (Jsonfeed.to_string feed)
API#
Jsonfeed.of_string/of_string_exn/of_reader/of_reader_exn- decode a feed.Jsonfeed.to_string/to_writer(both?indent ?preserve) - encode a feed.Jsonfeed.Item,Author,Attachment,Hub,Reference- the typed feed objects, each withcreate, accessors, and acodec.
Related Work#
- ocaml-jsonfeed - the
upstream this forks, by Anil Madhavapeddy, over
jsont. - nox-json / jsont - the JSON codec library this builds on.
License#
ISC (upstream's license). See LICENSE.md.