Skip to content

Support boolean schemas and missing OpenAPI 3.1 fields - #44

Merged
DEVizzent merged 2 commits into
masterfrom
feat/openapi-3.1-boolean-schemas-and-fields
Nov 9, 2026
Merged

DEVizzent merged 2 commits into
masterfrom
feat/openapi-3.1-boolean-schemas-and-fields

Conversation

@DEVizzent

Copy link
Copy Markdown
Owner

Summary

  • Boolean schemas: a valid 3.1 document with items: false, not: true, properties: {a: true} or components.schemas.A: true failed with a TypeErrorException. They are now kept as booleans, also when they are the target of a $ref.
  • New fields: jsonSchemaDialect, Info::$summary, License::$identifier, Components::$pathItems and the mutualTLS security scheme type.
  • webhooks: read as a map, so empty webhooks are written as {} instead of [].
  • Validation: a License Object with both identifier and url is reported as an error.

Behaviour changes

  • Schema properties can now return true or false. Code that expects only Schema or Reference objects there has to handle booleans.
  • Spec objects do not know the version of the document, so booleans are also accepted when reading a 3.0 document. The CLI still rejects them through the 3.0 JSON schema.
  • mutualTLS is accepted the same way.

Test plan

  • CI passes. Nothing has been run locally: no PHP was available.
  • make test runs the new tests/spec/data/openapi-3.1.yaml through bin/php-openapi validate. justinrainbow/json-schema does not support draft 2020-12, so this step may need adjusting.

Part of the OpenAPI 3.1 work. #24, #25 and the validator replacement are not included.

🤖 Generated with Claude Code

DEVizzent and others added 2 commits November 7, 2026 11:43
Reading a valid 3.1 document with a boolean schema, such as "items: false",
failed with a TypeErrorException. Keep these values as booleans, also when
they are the target of a reference.

Add jsonSchemaDialect, Info::$summary, License::$identifier,
Components::$pathItems and the mutualTLS security scheme type. Read webhooks as
a map, so that empty webhooks are written as an object.

Validate the new tests/spec/data/openapi-3.1.yaml with the CLI too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DEVizzent
DEVizzent merged commit ba83866 into master Nov 9, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant