Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 431 Bytes

runtime-parameters-validator.md

File metadata and controls

13 lines (10 loc) · 431 Bytes

Runtime parameters validator

This tool was not developed only for unit and functional tests. You can use to validate if the required body parameters is the expected.

So, before your API Code you can validate the request body using:

<?php
$schema = \ByJG\ApiTools\Base\Schema::getInstance($contentsOfSchemaJson);
$bodyRequestDef = $schema->getRequestParameters($path, $method);
$bodyRequestDef->match($requestBody);