Releases: utopia-php/openapi
Releases · utopia-php/openapi
Release list
0.2.0
- Map annotated string enumerations onto synthesized
StringSchemametadata while preserving theirCompositeSchematree. - Add
CompositeSchema::stringEnum()for closed and open annotated enums. - Derive enum type names from composite titles and value names from branch titles.
- Keep vendor extensions opaque instead of interpreting enum metadata from
x-enum-nameandx-enum-keys. - Reject malformed annotated enum unions with source JSON Pointer context.
This is a breaking release. Consumers using enum vendor extensions should migrate their specifications to annotated enumerations before upgrading.
0.1.5
- Preserve empty enum-key lists as the signal to derive identifiers.
- Continue rejecting partial non-empty enum-key mappings.
0.1.4
- Preserve typed enum metadata for OpenAPI 2 inline parameters.
- Reject partial enum-key mappings.
- Restrict open-enum recognition to unrestricted string branches.
0.1.3
- Expose typed enum names and keys on
StringSchema. - Preserve open string-enum provenance on extracted enum branches.
- Validate every
x-enum-keysentry as a string.
0.1.2
What's changed
- Expose the enum-bearing branch for open string enum
anyOfschemas throughCompositeSchema::openStringEnumBranch().
Full changelog: 0.1.1...0.1.2
0.1.1
Changed
- Stop interpreting the unofficial
x-nullableextension as schema nullability. - Preserve
x-nullableonly as an uninterpreted vendor extension where extensions are captured.
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