HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-02-21
1 <p>The REST style leaves a lot of decisions up to the developers.</p>
1 <p>The REST style leaves a lot of decisions up to the developers.</p>
2 <p>On the one hand, the task of REST is not to set a specification but to define the principles that allow you to build a good HTTP API. In this sense, REST is a well-thought-out concept, doesn't depend on trends, and has existed for decades without change.</p>
2 <p>On the one hand, the task of REST is not to set a specification but to define the principles that allow you to build a good HTTP API. In this sense, REST is a well-thought-out concept, doesn't depend on trends, and has existed for decades without change.</p>
3 <p>On the other hand, it has the freedom in:</p>
3 <p>On the other hand, it has the freedom in:</p>
4 <ul><li>How links are organized</li>
4 <ul><li>How links are organized</li>
5 <li>What data structures are sent</li>
5 <li>What data structures are sent</li>
6 <li>How data is returned</li>
6 <li>How data is returned</li>
7 </ul><p>It means all REST APIs are quite different and sometimes quite strong.</p>
7 </ul><p>It means all REST APIs are quite different and sometimes quite strong.</p>
8 <p>It leads to a large number of problems, which are easily solvable in the RPC protocols:</p>
8 <p>It leads to a large number of problems, which are easily solvable in the RPC protocols:</p>
9 <ul><li>The documentation is described manually and is different in each API</li>
9 <ul><li>The documentation is described manually and is different in each API</li>
10 <li>There's no automatic way to verify if API passes calls and parameters correctly</li>
10 <li>There's no automatic way to verify if API passes calls and parameters correctly</li>
11 <li>The language doesn't generate test code or data structures to work with API data</li>
11 <li>The language doesn't generate test code or data structures to work with API data</li>
12 <li>There's static analysis, such as highlighting incorrect queries in the editor</li>
12 <li>There's static analysis, such as highlighting incorrect queries in the editor</li>
13 </ul><p>The OpenAPI standard solves these and other issues. It is a simple and language-independent way to describe the API in a format that both machines and humans can understand. Programmers use it to automatically generate documentation, tests, and code for executing queries and checking the correctness of data:</p>
13 </ul><p>The OpenAPI standard solves these and other issues. It is a simple and language-independent way to describe the API in a format that both machines and humans can understand. Programmers use it to automatically generate documentation, tests, and code for executing queries and checking the correctness of data:</p>
14 <p>Here we can see a set of endpoints that define the structure of the parameters expected to be input and the output data. Using this description and the relevant libraries for each language, we can generate documentation, test code, the necessary classes to store this data, and even a library to perform queries to this API.</p>
14 <p>Here we can see a set of endpoints that define the structure of the parameters expected to be input and the output data. Using this description and the relevant libraries for each language, we can generate documentation, test code, the necessary classes to store this data, and even a library to perform queries to this API.</p>