Skip to content

Conversation

@torcolvin
Copy link
Contributor

I didn't preview with the actual docs site, which would be good to verify but this looks right in the test.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the handling of nested allOf schemas in OpenAPI specifications by making the child_entries function recursive. Previously, only top-level properties within allOf were extracted; now nested allOf structures are properly flattened.

  • Modified child_entries to recursively process allOf schemas instead of only extracting direct properties
  • Added test coverage for nested allOf scenarios
  • Updated test fixture to reflect the corrected output for nested schema structures

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/helpers/lib/each-openapi-module.js Changed via_allOf to recursively call child_entries instead of directly accessing properties
test/test-each-openapi.js Added test case verifying recursive allOf processing works correctly
test/fixtures/toc-bootstrap.html Updated fixture with previously missing console logging configuration entries now properly extracted

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@osfameron
Copy link
Collaborator

image looks good

a => Object.entries(a.properties || {})) || []
// allOf can be nested, so call child_entries recursively
const via_allOf = (node.allOf || []).flatMap(subNode =>
child_entries(subNode)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, it actually was that easy...
I was very much "can't program my way out of a paper bag" last time I looked at this...
Thanks for taking this on!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used AI to ask how I would do this in js based on how I would do this in another language.

@osfameron osfameron merged commit 5e5d039 into couchbase:master Nov 13, 2025
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.

2 participants