2017 © Pedro Peláez
 

library api-validator

eLife Sciences API validator

image

elife/api-validator

eLife Sciences API validator

  • Thursday, March 15, 2018
  • by thewilkybarkid
  • Repository
  • 7 Watchers
  • 0 Stars
  • 5,298 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 12 % Grown

The README.md

eLife API Validator for PHP

This library provides a validator for the eLife Sciences API., (*1)

It checks HTTP requests/responses to make sure that they match the specification. Currently only the body of the message is validated against the schema for that media type., (*2)

Dependencies

Installation

Execute composer require elife/api-validator:dev-master., (*3)

Usage

To validate a message:, (*4)

use eLife\ApiValidator\MessageValidator\JsonMessageValidator;
use eLife\ApiValidator\SchemaFinder\PathBasedSchemaFinder;
use JsonSchema\Validator;

$messageValidator = new JsonMessageValidator(new PathBasedSchemaFinder('/path/to/api/schemas'), new Validator());

$messageValidator->validate($message);

The Versions