Download the PHP package swisnl/openapi-spec-generator without Composer

On this page you can find all versions of the php package swisnl/openapi-spec-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openapi-spec-generator

OpenAPI v3 Spec Generator

Latest Version on Packagist Buy us a tree Build Status Total Downloads Maintained by SWIS

Designed to work with Laravel JSON:API

!!! Disclaimer: this project is work in progress and likely contains many bugs, etc !!!

What it can and can't

Can

Can't yet

TODO

🙏 Based upon initial prototype by martianatwork, glennjacobs and byte-it.

Install

Via Composer

Publish the config file

Usage

Generate the Open API spec

Note that a seeded DB is required! The seeded data will be used to generate Samples.

Descriptions

It's possible to add descriptions to your endpoints by implementing the DescribesEndpoints interface. The added method receives the generated route name as a parameter. This can be used to generate descriptions for all your schema endpoints.

Generating Documentation

Speccy

A quick way to preview your documentation is to use speccy serve command.

Ensure you have installed Speccy globally and then you can use the following command:

Warning: Seems like Speccy is abandoned (https://github.com/wework/speccy/issues/485).

Laravel Stoplight Elements

Easily publish your API documentation in a local route by using your OpenAPI document in your Laravel Application directly.

For this to work, you have to generate your spec in a public-available location, like the local 'public' disk available in Laravel applications:

After installing it, you should set its url config: STOPLIGHT_OPENAPI_PATH. For example, if you're using the 'public' disk:

Note: If you need a more dynamic way to get access to the spec URL (for example, in S3 you may need to use temporary URLs), you can publish its Blade template and replace some lines to generate your own URI. Also, you may need to add an Fetch interceptor to integrate it with your authentication methods.

With its default route, ¡you just need to access to your /api/docs route to preview your specs! :bowtie:

Check its configuration docs for further options.

Standalone Stoplight Elements Web Component

In addition to previous Laravel package, you can use the Stoplight Elements by yourself. It is available as React Component, or Web Component, making it easier for integrating into existing Content Management Systems with their own navigation.

This is useful when you need more advanced customizations in the routing system, integrate it in your existing Vue|React|Vanilla application, or publish it as a non-laravel static HTML site. But... you have to setup it manually. :sweat_smile:

Web component integrated in your Vue application

You can follow the instructions to use the standalone Web Component, grab it into a blade template and armor your view.

It has advanced options, like tryItCredentialPolicy="same-origin" to use your cookie-based authentication (like Sanctum).

Also, in your Blade view or Vue's app initializer, as this package uses Fetch API you can add interceptors to customize the "try it out" feature, like adding default headers for Content-Type and/or Accept to be 'application/vnd.api+json' to your requests.

Other options

You can check a more exhaustive list of options available at https://openapi.tools/#documentation

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

Apache License 2.0. All notable changes to the original work can be found in License File for more information.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

SWIS :heart: Open Source

SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.


All versions of openapi-spec-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
goldspecdigital/oooas Version ^2.8
justinrainbow/json-schema Version ^5.2
laravel-json-api/hashids Version ^1.1|^2.0|^3.0
symfony/yaml Version ^5.3|^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package swisnl/openapi-spec-generator contains the following files

Loading the files please wait ....