hmaus / spas-parser
Common interfaces for spas parsers
Installs: 428
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 1
Open Issues: 0
pkg:composer/hmaus/spas-parser
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
Parserinterface - 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\ParserSo you end up with\<Yourname>\Spas\Parser\Apib - The
parsemethod is supposed to return an array ofParsedRequestelements where each contains aParsedResponseto have a request/response pair - Publish your package on packagist and require it in your toolbox alongside spas to use it