Download the PHP package selency/openapi without Composer
On this page you can find all versions of the php package selency/openapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download selency/openapi
More information about selency/openapi
Files in selency/openapi
Package openapi
Short Description Provides a user-friendly, object-oriented library to build OpenAPI specifications using PHP.
License MIT
Homepage https://selency.fr
Informations about the package openapi
Selency OpenAPI
The OpenApi component provides a user-friendly, object-oriented API to build OpenAPI specifications using PHP.
Sponsor
Selency is a team of 80 people, each more committed than the last to promoting second-hand goods and doing something positive for our planet. Open-Source is perfectly aligned with our values, leading us to contribute back to the Symfony ecosystem through a series of components.
We're always looking for talented people, join us!
Usage
Selency OpenApi implements the OpenApi standard in its version 3.1. It allows to build documentations using PHP objects, giving more flexibility and reusability to OpenApi definitions. All features of OpenApi 3.1 are supported.
Writing documentation
The OpenApi component provides object-oriented PHP tools to build the documentation definition:
Splitting documentations in multiple files
The component provides a concept of Partial documentations to allow splitting the documentation in multiple files for readability:
Store documentation close to your application code
The OpenApi component provides two interfaces to help maintaining documentation by storing it close to your code:
SelfDescribingSchemaInterface
can be implemented by classes describing a schema (request, response, payloads, ...) ;SelfDescribingQueryParametersInterface
can be implemented by classes describing a list of query parameters ;
These interfaces are especially useful when using objects to handle inputs and outputs of your API:
You can then load these self-describing schemas/query params classes by providing the dedicated loader during compilation:
Note: in a Symfony application, SelfDescribingSchemaInterface and SelfDescribingQueryParametersInterface class are automatically added to the compiler, you don't need to do anything.
And use them in your definitions: