K
K
Konstantin2018-04-02 16:02:15
API
Konstantin, 2018-04-02 16:02:15

What is the point and benefit of using Swagger?

As far as I understand, Swagger allows you to describe the API using the config and then generate stubs for the client and server.
And what is the profit here?
If someone has worked with Swagger, what are its advantages/disadvantages?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2018-04-02
@sergey-gornostaev

So I received a couple of weeks an order for a backend for a mobile application. The mobile application itself will be made by a team of some Italians. It would be hard for me to establish interaction with them without swagger, otherwise they will simply go to the address of the dev server and be able to get a detailed description of the API and test it in operation.

U
unchase, 2019-06-06
@unchase

The advantage is that having (or not having) a server implementation of the REST API or an OpenAPI specification file (Swagger) you can:
- automatically generate documentation for it
- automatically generate client code for this REST API for many programming languages
​​- design Api using the specification , and implementation on the client side and on the service side can be handled by unrelated development teams
. For example, you can use the extension for Visual Studio 2017/2019 Unchase OpenAPI (Swagger) Connected Service to automatically generate C # or TypeScript code for the client ( article on medium.com), and C# controller code for the server from the specification file.
In fact, after generating the controller code, you can fill them with the functionality you need, and then call the controller methods from the generated client.

A
awesomer, 2018-04-02
@awesomer

Swagger also allows you to expose a documented API to the web (to the global or intracorporate), which simplifies the work of front-end developers.
For example, read here:
Как построить REST-like API в крупном проекте
Разработка под e-commerce, Проектирование и рефакторинг, Программирование, API, Блог компании Яндекс.Деньги
1. Единообразие, унификация, стандартизация, минимизация ошибок из-за взимонепонимания - когда над проектом работает несколько человек.
2. Взаимодействие фронтендеров и бэкендеров.
3. Если над проектом работает один человек - не столь важно. Но когда проект здоровый и ты все помнить уже не можешь - помогает.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question