softonic / openapi-validation-formats-extension
Softonic OpenApi validation formats extension
Installs: 38 748
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- opis/json-schema: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.4
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-11-10 19:18:24 UTC
README
This library adds some format validation for OpenAPI validation middleware package.
Installation
Via composer:
composer require softonic/openapi-validation-formats-extension
Documentation
Once installed you will be able to register the formats that you want from this package.
In this example we can see how to register the UUID format.
$validator = new OpenApiValidation(base_path() . '/swagger.json');
$validator->addFormat('string', 'uuid', new Uuid());
For more information about format registration refer to the OpenAPI validation middleware package documentation.
Testing
softonic/openapi-validation-formats-extension
has a PHPUnit test suite and a coding style compliance test suite using PHP CS Fixer.
To run the tests, run the following command from the project folder.
$ docker-compose run tests
To run interactively using PsySH:
$ docker-compose run psysh
License
The Apache 2.0 license. Please see LICENSE for more information.