Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON-RPC sections to README. #12

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 137 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,25 @@ various tasks related to processing the JSight API language.
**JSight API language** – you've never designed API so fast. We mean it. [Compare JSight with Open
API](#scroll--jsight-api-language).

Supported standards: [HTTP REST](#scroll--jsight-api-language), [JSON-RPC 2.0](#json-rpc-20-new-feature).

Currently, the **JSight Server API** allows you to perform only one task:

1. Parsing code in the JSight API language, which results in a JSON structure containing all
information about this API in the *JDoc Exchange Format*.

The following features are also planned in the near future:

1. Converting from JSight API to OpenAPI.
2. Converting from OpenAPI to JSight API.
3. API documentation generation in MarkDown format.
4. API documentation generation in PDF format.
5. Generation of API server code stubs for different programming languages ​​(Java, PHP, Go,
1. Support for other types of API: gRPC, Kafka, RabbitMQ, WebSocket.
2. Converting from JSight API to OpenAPI.
3. Converting from OpenAPI to JSight API.
4. API documentation generation in MarkDown format.
5. API documentation generation in PDF format.
6. Generation of API server code stubs for different programming languages ​​(Java, PHP, Go,
Node.js, Python, C++ etc.).
6. Generation of API clients for different programming languages ​​(JavaScript, Java, PHP, Go,
7. Generation of API clients for different programming languages ​​(JavaScript, Java, PHP, Go,
Python, C++ etc.).
7. And many other features.
8. And many other features.

> :fire: If you have any ideas or suggestions, please share with us:
>
Expand Down Expand Up @@ -385,8 +388,8 @@ For more information on configuring the JSight Server, see the

## :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](https://jsight.io/docs/jsight-api-0-3). Here we give examples of the same API
described using JSight API and OpenAPI.
Expand Down Expand Up @@ -1535,6 +1538,130 @@ We did not describe this API in OpenAPI. It is too complicated and very long…

</details>

#### JSON-RPC 2.0. New Feature!

<details><summary>Example 9. JSON-RPC 2.0</summary>

<table align="center">
<thead>
<tr>
<th width="50%">
JSight API 0.3
</th>
<th>
OpenRPC 1.2.1
</th>
</tr>
</thead>
<tbody>
<tr valign="top">
<td>

```
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).

<div align="center">

:star: **Star us on GitHub — it motivates us a lot!**

</div>

</td>
<td>

```
{
"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"
}
]
}
}
]
}
]
}
```

</td>
</tr>
</tbody>
</table>

</details>

<div>
&nbsp;
</div>
Expand Down Expand Up @@ -1770,4 +1897,4 @@ We sincerely thank all those without whom this project would not have been possi

:star: **Star us on GitHub — it motivates us a lot!** :star:

</div>
</div>