0.1.0
First tagged release.
A framework-independent OpenAPI parser with an immutable canonical model. A 2.0, 3.0 or 3.1 document reads into the same Specification shape, so consumers do not branch on the source version.
What it gives you
- One model for three versions.
Utopia\OpenAPI\Parser::parse()detects the version and returns aSpecification. A Swagger 2 document and the OpenAPI 3.1 document describing the same service produce the same shape. - Typed schemas. One class per kind —
ObjectSchema,ArraySchema,StringSchema,CompositeSchema,ReferenceSchema, and so on — all extendingSchema, all readonly. - References left intact. A
$refbetween schemas is preserved as aReferenceSchemarather than expanded, because recursive schema graphs are legal. Object references (parameters, responses, examples, security schemes) are resolved. - Extensions preserved. Any
x-prefixed key is captured on every model that can carry one, and never interpreted. - Located errors. Parse failures name their position as a JSON Pointer, so a bad value is traceable to where it came from.
Requirements
PHP 8.5+, ext-json.
Install
composer require utopia-php/openapi