OpenAPI Initializer is a Laravel package that provides a straightforward command to scaffold an OpenAPI spec file.
Once you install the package, you can run the artisan command to walk you through various questions to make the OpenAPI specification.
You start by running the command:
1php artisan openapi:create
Then the plugin will walk you through a bunch of questions to construct the specification file:
Once you walk through the questions, OpenAPI Initializer will generate an openapi.yml
specification file that will look similar to the following:
1openapi: 3.0.3 2info: 3 title: '' 4 version: 0.1.0 5 description: 'Test API' 6 contact: { name: 'Laravel News', email: user@example.com, url: null } 7servers: 8 - { url: 'http://openapi-demo.test', description: 'Local url for testing' } 9tags: null10paths: null11components:12 schemas: null13 responses: null14 headers: null15 parameters: null16 links: null17 examples: null
You can learn more about this package, get full installation instructions, and view the source code on GitHub. If you’d like the know more about OpenAPI, I suggest an OpenAPI 3.0 Tutorial and the OpenAPI Specification (3.0.3) document.
0 comments:
Post a Comment
Thanks