Download the PHP package njuhel/swagger-validator without Composer
On this page you can find all versions of the php package njuhel/swagger-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download njuhel/swagger-validator
More information about njuhel/swagger-validator
Files in njuhel/swagger-validator
Package swagger-validator
Short Description 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).
License Apache-2.0
Informations about the package swagger-validator
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.
Swagger is old name of OpenAPI Projet and who manage the OAI Specification
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.
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 :
-
Install by cloning git :
-
Install with composer (adding this in composer.json):
- Install with phar :
Example & Docs
- Examples : Example.php
- Documentation : generated
All versions of swagger-validator with dependencies
ext-bcmath Version *
ext-dom Version *
ext-json Version *
ext-pcre Version *
ext-reflection Version *
ext-spl Version *