tdmrep provides typed OCaml values and Jsont codecs for the W3C TDM Reservation Protocol final report of 10 May 2024.
It covers:
/.well-known/tdmrep.json rule files;tdm-reservation and tdm-policy HTTP fields;open Tdmrep
let policy =
Uri.of_string "https://provider.example/policies/1"
let declaration =
Declaration.make ~reservation:`Reserved ~policy ()
let response_fields = Http.encode declaration
let rules =
Well_known.make
[ Rule.make ~location:"/" ~reservation:`Reserved ~policy () ]
let json =
Jsont_bytesrw.encode_string ~format:Jsont.Indent Well_known.jsont rulesUse Well_known.jsont and Policy.jsont with any Jsont backend, or embed it into your HTTP server for dynamic policies.