1234567891011121314151617181920212223242526moduleJson=Chatoyant_runtime.Jsontypet=Boolofbool|Objectof(string*Json.t)listtypeparse_error={path:string;message:string}letof_json=function|Json.Boolvalue->Ok(Boolvalue)|Json.Objectfields->Ok(Objectfields)|_->Error{path="";message="JSON Schema must be a boolean or object"}letof_stringsource=matchJson.parsesourcewith|Errormessage->Error{path="";message}|Okjson->of_jsonjsonletto_json=function|Boolvalue->Json.Boolvalue|Objectfields->Json.Objectfieldsletto_stringschema=schema|>to_json|>Json.to_stringletfields=functionBool_->None|Objectfields->Somefieldsletfieldname=function|Bool_->None|Objectfields->List.assoc_optnamefields