From 4a30cb442f3e2290d88bfc78ed1a3add7384cd2a Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 26 Jul 2023 09:56:24 +0100 Subject: [PATCH] jsonMessages: basic schema for JSON APIs JSON APIs are ubiquitous. This schema allows for reusuable connectors that translate Preserves to and from JSON endpoints. This schema contradicts the current JSON schema described in the Preserves spec because it uses symbols for object keys rather than strings. --- schemas/jsonMessages.prs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 schemas/jsonMessages.prs diff --git a/schemas/jsonMessages.prs b/schemas/jsonMessages.prs new file mode 100644 index 0000000..60d7239 --- /dev/null +++ b/schemas/jsonMessages.prs @@ -0,0 +1,19 @@ +version 1 . + +JSON = +/ @string string +/ @integer int +/ @double double +/ @boolean bool +/ @null =null +/ @array [JSON ...] +/ @object { symbol: JSON ...:... } . + +; Messages that might be exchanged over a point-to-point medium such as a TCP or UNIX socket. +Message = SendJSON / RecvJSON . + +; A message destined for a remote endpoint. +SendJSON = . + +; A message originating from a remote endpoint. +RecvJSON = .