This package allows you to parse Arazzo Specifications into plain old PHP objects.
use HSkrasek\Arazzo\Parser;
$specification = Parser::parse(
file_get_contents('https://raw.githubusercontent.com/bump-sh-examples/train-travel-api/a97f549346f8cb44ec8d5e9d08cfe57b8b09cd6e/arazzo.yaml')
);
var_dump($specification);
//object(HSkrasek\Arazzo\Specification\Arazzo)#636 (5) {
// ["arazzo"]=>
// enum(HSkrasek\Arazzo\Specification\Version::V1_0_1)
// ["info"]=>
// object(HSkrasek\Arazzo\Specification\Info)#736 (4) {
// ["title"]=>
// string(30) "BNPL Loan Application Workflow"
// ["version"]=>
// string(5) "1.0.0"
// ["summary"]=>
// NULL
// ["description"]=>
// string(354) "This workflow walks through the steps to apply for a BNPL loan at checkout, including checking product eligibility, retrieving terms and conditions, creating a customer record, initiating the loan transaction, customer authentication, and retrieving the finalized payment plan. It concludes by updating the order status once the transaction is complete."
// ...
// }You can install the package via composer:
composer require hskrasek/arazzo-parserYour main and only entrypoint will be the Parser, which supports parsing an Arazzo Specification via many different methods and all standard formats.
use HSkrasek\Arazzo\Parser;
// Parse an Arazzo specification string
$specification = Parser::parse(
file_get_contents('https://raw.githubusercontent.com/bump-sh-examples/train-travel-api/a97f549346f8cb44ec8d5e9d08cfe57b8b09cd6e/arazzo.yaml')
);
// or parse an Arazzo specification from a file
$specification = Parser::parse(new SplFileObject(__DIR__ . '/arazzo.yaml'));
// or parse an Arazzo specification from a resource handler
$specification = Parser::parse(fopen(__DIR__ . '/arazzo.yaml'));composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.