Skip to content

0.1.0

Choose a tag to compare

@ChiragAgg5k ChiragAgg5k released this 14 Aug 07:24
· 14 commits to main since this release
5962baf

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 a Specification. 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 extending Schema, all readonly.
  • References left intact. A $ref between schemas is preserved as a ReferenceSchema rather 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