July 2018
Intermediate to advanced
420 pages
8h 46m
English
As you can see from the previous examples, we have already added the documentation of our API through the Swagger definitions to our recently created controllers. This is the same code we used in the previous example. Let's generate the documentation on the Swagger UI.
Open your Terminal window and type the following command:
php artisan l5-swagger:generate
As you can note on the previous Swagger definitions on error messages, we have some new HTTP errors, such as 422.
This means that if the user tries to input some data with one or more missing required fields, our API must return an HTTP error code. This will be 422. So, let's see how we can implement some validation and verify some common API HTTP codes. ...
Read now
Unlock full access