hmaus / spas-parser
This package is abandoned and no longer maintained.
No replacement package was suggested.
Common interfaces for spas parsers
v2.2.0
2016-12-13 08:16 UTC
Requires
- php: >=7.0
- hmaus/reynaldo: ^0.1.1
- symfony/http-foundation: ^3.1
This package is not auto-updated.
Last update: 2020-08-21 20:47:47 UTC
README
Defines common interfaces for creating concrete parsers that work with spas testing tool.
Details
Spas is a tool to test an API description against a given environment.
As spas itself is description language agnostic, it relies on different concrete implementations
of spas-parser which defines the common interfaces.
Installation
The recommended way to install, is using composer:
composer require hmaus/spas-parser
Implementations
- API Blueprint Refract ParseResult - spas-parser-apib
How To Create A Parser
Have a look at spas-parser-apib for a working example
- Start a new composer library
- Implement the
Parser
interface - To keep things aligned, name your implementation
<Language>
, e.g.Apib
- The namespace is up to you, I suggest
<Yourname>\Spas\Parser
, e.g.Hmaus\Spas\Parser
So you end up with\<Yourname>\Spas\Parser\Apib
- The
parse
method is supposed to return an array ofParsedRequest
elements where each contains aParsedResponse
to have a request/response pair - Publish your package on packagist and require it in your toolbox alongside spas to use it