A
A
Anton Shtinov2017-02-10 16:48:04
PHP
Anton Shtinov, 2017-02-10 16:48:04

What to use to design and develop a REST API?

Of the popular REST API design and documentation tools, there are swagger and apiary. The main approach is to use REST frameworks like Laravel(Lumen), Guzzle, Silex and Swagger-style annotations, based on which you can then build a file for Swagger.
But I did not see the reverse approach, so that on the basis of the Swagger project it would be possible to assemble a skeleton for the REST server - routing, checking parameters and input data.
This raises the question of how best to develop a REST API, which framework to use in order to do less unnecessary work on developing and documenting the server.
For now, I tend to use something from Lumen or Guzzle with Swagger annotations.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Z
zatupok3000, 2017-02-10
@zatupok3000

We have a project for 100,000 people a day, we use laravel, we really like it.

M
Maxim Timofeev, 2017-02-10
@webinar

Here are the guides:
www.yiiframework.com/wiki/748/building-a-rest-api-...
www.yiiframework.com/doc-2.0/guide-rest-quick-star...
Fast, simple, flexible

S
Stanislav Makarov, 2017-02-10
@Nipheris

https://github.com/swagger-api/swagger-codegen
Server stubs: C# (ASP.NET Core, NancyFx), Erlang, Go, Haskell, Java (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), PHP (Lumen, Slim, Silex, Zend Expressive ), Python (Flask), NodeJS, Ruby (Sinatra, Rails5), Scala (Finch, Scalatra)
We ourselves dream of integrating the generation of routing and DTOs according to the swagger specification directly into the build process, but we still cannot boast of this)

U
unchase, 2019-06-10
@unchase

Having (or not having) a server implementation of the REST API or an OpenAPI (Swagger) specification file, you can:
- automatically generate documentation for it
- automatically generate client code for the existing REST API for many programming languages
​​- design Api using the specification, and the implementation on the side The client and 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 according to the specification file ( this is also possible ).
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.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question