More JSON, less HSON?

4 views
Skip to first unread message

Wouter Hendriks

unread,
Dec 2, 2024, 10:47:48 AMDec 2
to General WebHare developers discussion
I noticed WRD supports “<json>” nowadays, does that mean you guys are abandoning HSON a bit?

Arnold Hendriks

unread,
Dec 2, 2024, 11:16:32 AMDec 2
to General WebHare developers discussion, Wouter Hendriks
If a wrd field is only read and written by JS, there's no point in having to use hson (and defining all the empty array fields explicitly with a type, or risking an error about variant arrays)

But the real point of JSON fields are that you can connect them to TS definitions:

      <json tag="conditions" typedeclaration="mod::system/data/wrdschemas/config_types.ts#ManualCheckMessagesConditions" />

There won't be any runtime validation whether the stored data matches the type but the TS WRD APIs will pick up the type definitions
Reply all
Reply to author
Forward
0 new messages