Skip to content

fix: handle allOf with incompatible types#1308

Merged
sserrata merged 1 commit intoPaloAltoNetworks:mainfrom
emmanuel-ferdman:fix-allof
Feb 17, 2026
Merged

fix: handle allOf with incompatible types#1308
sserrata merged 1 commit intoPaloAltoNetworks:mainfrom
emmanuel-ferdman:fix-allof

Conversation

@emmanuel-ferdman
Copy link
Contributor

Description

When an allOf contains sub-schemas with incompatible primitive types (e.g. string + integer), the allof-merge library returns undefined. The code then tries to access .readOnly on that and craches. Fixed by falling back to an empty object {} in both the plugin and theme mergeAllOf wrappers. All call sites already handle empty objects fine.

Motivation and Context

Pages with these kinds of allOf schemas crash on load. This comes up when an API spec overrides a property type through allOf composition, like changing an integer field to a string enum.

Fixes #1231

How Has This Been Tested?

  • Added two unit tests for sampleFromSchema with incompatible allOf (top-level and inside a property)
  • Added a test endpoint in demo/examples/tests/allOf.yaml

Screenshots (if appropriate)

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
@sserrata sserrata self-assigned this Feb 17, 2026
@sserrata sserrata added enhancement New feature or request reviewing 👀 Undergoing manual audit to determine if issue should still be active labels Feb 17, 2026
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 3ec416b):

https://docusaurus-openapi-36b86--pr1308-zzh2tsab.web.app

(expires Thu, 19 Mar 2026 19:30:38 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata sserrata merged commit 6198c9b into PaloAltoNetworks:main Feb 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request reviewing 👀 Undergoing manual audit to determine if issue should still be active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"can't access property "readOnly", mergedSchemas is undefined" while opening a generated page

2 participants

Comments