Skip to content

[@W-21368901] fix(deep-allof): recursively collect properties from 4+ level allOf chains#97

Merged
alexpmule merged 5 commits intomainfrom
fix/W-21368901-deep-allof
Mar 3, 2026
Merged

[@W-21368901] fix(deep-allof): recursively collect properties from 4+ level allOf chains#97
alexpmule merged 5 commits intomainfrom
fix/W-21368901-deep-allof

Conversation

@alexpmule
Copy link
Contributor

Summary

Fixes W-21368901 - API Console not displaying properties from deeply nested allOf schemas (4+ levels).

Problem

Customer reported missing date and timeSlot fields in PXCAppointmentRef schema. Root cause: ApiTypeDocument only collected direct properties from allOf, missing properties in nested allOf structures.

Solution

  • Added _collectAndPropertiesRecursive() method to recursively traverse allOf chains
  • Updated _computeProperties() to use recursive collection when shacl:and is present
  • Circular reference detection with visited Set
  • Deduplicates properties by @id to avoid duplicates

Testing

  • ✅ Test added in test/product-order-examples.test.js
  • ✅ Manual verification: PXCAppointmentRef now shows all properties in UI

Dependencies

  • Updated to @api-components/api-example-generator@4.4.36

Related

Screen.Recording.2026-03-03.at.5.03.29.PM.mov

…hains

Fixes W-21368901 - Deeply nested allOf schemas (4+ levels) were not
displaying all properties in API Console.

Changes:
- Add _collectAndPropertiesRecursive() method to handle nested allOf
- Update _computeProperties() to use recursive collection when allOf present
- Circular reference detection with visited Set
- Test added in test/product-order-examples.test.js

Impact:
- Schemas like PXCAppointmentRef now show all properties including
  date, timeSlot from deeply nested allOf chains
- Deduplicates properties by @id to avoid duplicates
- Backward compatible: augments existing logic, no breaking changes

Related:
- Depends on @api-components/api-example-generator@4.4.36
NazaQuintero
NazaQuintero previously approved these changes Mar 3, 2026
…separately

- Restored original product-order-minimal*.json (had ProductOrder_FVO tests)
- Added new product-order-deep-allof*.json with PXCAppointmentRef for W-21368901
- Updated .gitignore to allow new model files
- Updated demo/index.js to include both models
- All tests now pass (547 passed, 0 failed)
@alexpmule alexpmule merged commit cf8b660 into main Mar 3, 2026
4 checks passed
@alexpmule alexpmule self-assigned this Mar 4, 2026
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