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). +
 
@@ -136,8 +139,8 @@ https://editor.jsight.io. ## :scroll:   JSight API language -The JSight API language allows you to specify REST APIs with incredible speed and convenience. More -information can be found in the [Quick +The JSight API language allows you to specify REST and JSON-RPC APIs with incredible speed and +convenience. More information can be found in the [Quick Tutorial](https://jsight.io/docs/jsight-api-0-3-quick-tutorial) or in the [language specification](./versions/JSight%20API/). Here we give examples of the same API described using JSight API and Open API. @@ -1286,6 +1289,130 @@ We did not describe this API in OpenAPI. It is too complicated and very long… +#### JSON-RPC 2.0. New Feature! + +
Example 9. JSON-RPC 2.0 + + + + + + + + + + + + + + +
+ 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" + } + ] + } + } + ] + } + ] +} +``` + +
+ +
+
 
@@ -1725,8 +1852,7 @@ Read more about built-in data types in the JSight Schema Language Specification, ## :date:   Roadmap -- July 2022 — Support for the JSON-RPC 2.0 standard. -- November 2022 — Support for other types of API: gRPC, Kafka, RabbitMQ, WebSocket. +- Support for other types of API: gRPC, Kafka, RabbitMQ, WebSocket. If you have ideas and suggestions, please write to us: