Skip to content

fix: delete falsy referenced properties in endpoint generator - #137

Open
kskszq wants to merge 1 commit into
agi-inc:mainfrom
kskszq:fix/openapi-property-removal
Open

kskszq wants to merge 1 commit into
agi-inc:mainfrom
kskszq:fix/openapi-property-removal

Conversation

@kskszq

@kskszq kskszq commented Oct 3, 2026

Copy link
Copy Markdown

Pull Request

Description

When a nested reference resolves to a falsy value, the endpoint documentation generator calls .pop() on a plain properties object and throws TypeError: temp.properties.pop is not a function. Use delete temp.properties[key] to remove that property, and forEach for the traversal whose return value is unused.

Checklist

  • My changes follow the existing code style (two changed lines).
  • Reproduced the reported failure before the fix and verified the same resolver checks pass afterward.
  • Checked leaf schemas, nested references, and preservation of sibling properties when removing a falsy reference.
  • JavaScript syntax check and git diff --check pass.
  • Prettier 3.0.0 formatting check passes.
  • Maintainer review is pending.

Additional Notes

Validation uses a small local Node.js harness that executes the existing resolveRef function with a controlled $refs.get implementation. The failing fixture returns false; this verifies the existing falsy-removal branch, not end-to-end parsing of an invalid OpenAPI document. The full website build and documentation generation have not been run. This does not add recovery for missing references rejected by the OpenAPI parser.

Developed with AI assistance.

References, Fixes and Closes

Fixes #133

Copilot AI balanced review requested due to automatic review settings October 3, 2026 12:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

Unhandled TypeError in OpenAPI generation script (Object.pop is not a function)

2 participants