Download the PHP package cschindl/php-openapi-mock-middleware without Composer
On this page you can find all versions of the php package cschindl/php-openapi-mock-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cschindl/php-openapi-mock-middleware
More information about cschindl/php-openapi-mock-middleware
Files in cschindl/php-openapi-mock-middleware
Package php-openapi-mock-middleware
Short Description PSR-15 Middleware that simulates the API responses using an OpenAPI schema.
License MIT
Informations about the package php-openapi-mock-middleware
php-openapi-mock-middleware
PSR-15 Middleware that simulates the API responses using an OpenAPI schema.
Define requests/responses using the OpenAPI schema and this data is immediately available, so development/testing against this API can begin even though the functionality has not yet been implemented.
Requirements
- PHP >= 8.0
- PSR-17 HTTP factories implementation
- PSR-15 HTTP server middleware dispatcher
- PSR-6 Caching interface implementation (optional)
Installation
You can install the package via composer:
Example usage
To see how to use and extend OpenApiMockMiddleware
, have a look at our example project.
Usage
First you need to create an instance of OpenApiMockMiddleware
with your schema that you want to fake data from. You can use createFromYamlFile
, createFromJsonFile
, createFromYaml
or createFromJson
to create an instance of OpenApiMockMiddleware
.
After that, register the middleware.
Options
There are some options you can use to modify some behaviour.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
People:
- Carsten Schindler
- All Contributors
Resources:
License
The MIT License (MIT). Please see License File for more information.
All versions of php-openapi-mock-middleware with dependencies
canvural/php-openapi-faker Version ^2.1
psr/cache Version ^1.0 || ^2.0 || ^3.0
psr/http-factory Version ^1.0.1
psr/http-message Version ^1.0.1
psr/http-server-middleware Version ^1.0.1