# Remote Specification Validation ## Installation ```php composer require woocommerce/remote-specs-validation ``` ## Available Schemas | Filename | Endpoint | Bundle | | --------------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------- | | remote-inbox-notification.json | | remote-inbox-notification | | payment-gateway-suggestions.json | | payment-gateway-suggestions | | obw-free-extensions.json | | obw-free-extensions | | wc-pay-promotions.json | | wc-pay-promotions | | shipping-partner-suggestions.json | | shipping-partner-suggestions | ## Working with Schema If it's your first time working with JSON Schema, we highly recommend reading first. 1. Open a schema file from `schemas` directory. 2. Make changes. 3. Run `./bin/build schemas/:name-of-schema-file` 4. Bundled schema file will be saved in `bundles` directory. ## Validation Examples ```php use Automattic\WooCommerce\Tests\RemoteSpecsValidation\RemoteSpecValidator; $validator = RemoteSpecValidator::create_from_bundle( 'remote-inbox-notification' ); $spec = json_decode( file_get_contents(":your-remote-inbox-noficiation-json") ); $result = $validator->validate( $spec ); if ( !$result->is_valid() ) { var_dump( $result->get_errors() ); } else { var_dump('everyting looks good!'); } ```