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

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

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 of ParsedRequest elements where each contains a ParsedResponse to have a request/response pair
  • Publish your package on packagist and require it in your toolbox alongside spas to use it