From d5b7565c5a060226d40dd1acb605680baf9814bb Mon Sep 17 00:00:00 2001 From: Andrew Platonov <104552116+andrew-platonov@users.noreply.github.com> Date: Tue, 4 Oct 2022 14:15:32 +0000 Subject: [PATCH] Add JSON-RPC sections to README.md. --- README.md | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 130 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 565a9fb..debe4de 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ fast! We mean it. [Compare **JSight API** with **Open API**](#scroll--jsight-api-language). [Compare **JSight Schema** with **JSON Schema**](#scroll--jsight-schema-language). +Supported standards: [HTTP REST](#scroll--jsight-api-language), [JSON-RPC +2.0](#json-rpc-20-new-feature). +
| + JSight API 0.3 + | ++ OpenRPC 1.2.1 + | +
|---|---|
|
+
+```
+JSIGHT 0.3
+URL /
+ Protocol json-rpc-2.0
+ Method listPets // List all pets
+ Params
+ [
+ 20 // Limit (how many items to return).
+ ]
+ Result
+ [ // An array of pets
+ { // Pet
+ "id": 123,
+ "name": "Tom"
+ }
+ ]
+
+```
+
+The JSON-RPC API is as simple to describe as the REST API.
+
+More about JSON-RPC 2.0 support: [Quick Tutorial. JSON-RPC 2.0
+support](https://jsight.io/docs/jsight-api-0-3-quick-tutorial/lesson10).
+
+
+
+:star: **Star us on GitHub — it motivates us a lot!**
+
+
+
+ |
++ +``` +{ + "openrpc": "1.2.1", + "info": { + "version": "", + "title": "" + }, + "methods": [ + { + "name": "listPets", + "description": "List all pets", + "params": [ + { + "name": "limit", + "description": "How many items to return", + "schema": { + "type": "integer" + } + } + ], + "result": { + "name": "pets", + "description": "An array of pets", + "schema": { + "type": "array", + "items": { + "title": "Pet", + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + }, + "examples": [ + { + "name": "listPetExample", + "description": "List pet example", + "params": [ + { + "name": "limit", + "value": 20 + } + ], + "result": { + "name": "listPetResultExample", + "value": [ + { + "id": 123, + "name": "Tom" + } + ] + } + } + ] + } + ] +} +``` + + | +