2017 © Pedro Peláez
 

library swagger-validator

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

image

njuhel/swagger-validator

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  • Tuesday, April 25, 2017
  • by njuhel
  • Repository
  • 3 Watchers
  • 15 Stars
  • 1,655 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 5 Open issues
  • 23 Versions
  • 2 % Grown

The README.md

Dependency Status ~ Code Climate ~ Test Coverage ~ Travis branch, (*1)

Packagist ~ Composer, (*2)

Swagger Validator PHP

A Swagger(OpenAPI) Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response., (*3)

Swagger is old name of OpenAPI Projet and who manage the OAI Specification, (*4)

Why Using a Swagger Validator

A Swagger Validator could be understand as a validation of our swagger definition file with the swagger definition. A Swagger Parser could be understand as a parser for request entry (sometimes in addition parsing response) The Swagger Validator is doing all this. It validate your swagger file, validate your entry request and response., (*5)

Validation / Parsing are mandatory

  • validating the swagger guarantee that your definition file has no error and will be understand correctly
  • validating the request is a security stage to filter bad request, attempted hack, limit the control and filtering statement in your working source code, ...
  • validating the response is also security stage to filter not needed information before sent them, to limit and prevent error code attack, limit the control and filtering statement in your working source code ...

Features

  • Best for Swagger First, Code after
  • Validate / Filter All Request & Response
  • Integration easy with any existing framework, application, ...
  • Allow a soft migration for a complete application MVC to HIM/API application
  • Give example model of request/response based on the swagger to example built automated testing stage, human skeleton for code, documentation skeletton, ...
  • Validate the swagger file in following the Swagger 2.0 specification and JSON Draft v4 (swagger has higher priority to json draft 4)
  • Custimization easy : all classes are overriding without writing the parser (using a customized factory)
  • Working finely with single and multi file swagger definition
  • Can generate single swagger definition file based on multi swagger definition file
  • Allow local and remote definition file
  • Allow using circular reference (only for no required properties in an object)
  • Store validated request params into a sandbox to access only validated params (and clean magics globals variables)
  • Follow RFC and recommandation for primitive type and format and not native language understanding type and format
  • Using cache for working file in parsing request/response
  • Using easy overriding IO class for collect request/response data to be validated
  • Unit test in your environnement for checking compatibility

Need to do

  • response building automaticly base on content type response, accept and produce
  • reduce scope to PHP 7.1 (release >= 1.4)
  • swagger / openapi version 3.0 (release >= 2.0)

Compatibility

  • release <= 1.3 : scope PHP 5.3.10 (bug reported, need some more compatibilities) to PHP 7.0
  • release >= 1.4 : scope PHP 7.1
  • release >= 2.0 : openapi release 3.0 & PHP 7.1

Installation Guide

  • Install into a git repository as submodule :
git submodule init
git submodule add http://srv01.https://github.com/nabbar/SwaggerValidator-PHP src/lib/SwaggerValidator
git submodule update
  • Install by cloning git :
git clone https://github.com/nabbar/SwaggerValidator-PHP SwaggerValidator
  • Install with composer (adding this in composer.json):
    "require": {
        "nabbar/swagger-validator":">=1.2.0"
    },
  • Install with phar :
wget https://github.com/nabbar/SwaggerValidator-PHP/raw/master/bin/SwaggerValidator.phar 

Example & Docs

The Versions

25/04 2017

dev-master

9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

24/04 2017

v1.3.2.x-dev

1.3.2.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

24/04 2017

1.3.2

1.3.2.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

24/04 2017

v1.3.1.x-dev

1.3.1.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

24/04 2017

1.3.1

1.3.1.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

17/10 2016

v1.3.0.x-dev

1.3.0.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

17/10 2016

dev-develop

dev-develop

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

17/10 2016

1.3.0

1.3.0.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

11/09 2016

v1.2.3.x-dev

1.2.3.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

11/09 2016

1.2.3

1.2.3.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

10/09 2016

v1.2.2.x-dev

1.2.2.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

10/09 2016

1.2.2

1.2.2.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

05/09 2016

v1.2.1.x-dev

1.2.1.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

05/09 2016

1.2.1

1.2.1.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

21/08 2016

v1.2.0.x-dev

1.2.0.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

21/08 2016

1.2.0

1.2.0.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-bcmath *
  • ext-dom *
  • ext-json *
  • ext-pcre *
  • ext-reflection *
  • ext-spl *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

07/08 2016

v1.1.x-dev

1.1.9999999.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

07/08 2016

1.1.0

1.1.0.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

03/08 2016

v1.0.x-dev

1.0.9999999.9999999-dev

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

03/08 2016

1.0.0-p4

1.0.0.0-patch4

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

01/08 2016

1.0.0-p3

1.0.0.0-patch3

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

30/07 2016

1.0.0-p2

1.0.0.0-patch2

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL

api parser php filter validator security model swagger openapi oai restfull

30/07 2016

1.0.0

1.0.0.0

A Swagger Validation and Parser as lib for PHP to secure and helpful application for request / response validating, security stage, testunit skeleton, testauto generation, ... This lib can be used into any existing application who's having a swagger definition file for request/response (no framework dependancies or included).

  Sources   Download

Apache-2.0

The Requires

  • php >5.3.10
  • ext-json *
  • ext-pcre *
  • ext-spl *
  • ext-dom *
  • ext-reflection *

 

The Development Requires

by Nicolas JUHEL