Releases: osteel/openapi-httpfoundation-testing
Releases · osteel/openapi-httpfoundation-testing
Release list
v0.7.2
v0.7.1
What's Changed
- Dependency Update - league/openapi-psr7-validator to 0.17 by @johnathanmdell in #16
New Contributors
- @johnathanmdell made their first contribution in #16
Full Changelog: v0.7...v0.7.1
v0.7
v0.6.1
v0.6
Breaking changes
Request and response validators merged
The request and response validators are now a single Validator class, and so are the validator builders:
// before
use Osteel\OpenApi\Testing\Response\ResponseValidatorBuilder;
use Osteel\OpenApi\Testing\Response\ResponseValidator;
use Osteel\OpenApi\Testing\Request\RequestValidatorBuilder;
use Osteel\OpenApi\Testing\Request\RequestValidator;
// now
use Osteel\OpenApi\Testing\ValidatorBuilder;
use Osteel\OpenApi\Testing\Validator;As a result, validating request and response objects is now done by the same object and requires the same parameters:
$validator = ValidatorBuilder::fromYaml('my-definition.yaml')->getValidator();
$validator->validate($request, '/users', 'post');
$validator->validate($response, '/users', 'post');Note that before these changes, validating a request only required the request object, with no parameters.
Pull requests
- #8 Unified interface for both request and response validation
v0.5
Breaking changes
Namespaces
The request and response validators are now under their own namespaces:
// before
use Osteel\OpenApi\Testing\ResponseValidatorBuilder;
use Osteel\OpenApi\Testing\ResponseValidator;
use Osteel\OpenApi\Testing\RequestValidatorBuilder;
use Osteel\OpenApi\Testing\RequestValidator;
// now
use Osteel\OpenApi\Testing\Response\ResponseValidatorBuilder;
use Osteel\OpenApi\Testing\Response\ResponseValidator;
use Osteel\OpenApi\Testing\Request\RequestValidatorBuilder;
use Osteel\OpenApi\Testing\Request\RequestValidator;Response validation parameters
The order of the parameters have changed for the response validation methods (validate, get, post, etc.). The response object is now in first position, e.g.:
// before
$validator->validate('/users', 'get', $response);
// now
$validator->validate($response, '/users', 'get');