Skip to content

test: add test cases for recursion detection#1273

Open
KUNDAN1334 wants to merge 9 commits intoasyncapi:masterfrom
KUNDAN1334:fixes-in-recursion-detection-logic
Open

test: add test cases for recursion detection#1273
KUNDAN1334 wants to merge 9 commits intoasyncapi:masterfrom
KUNDAN1334:fixes-in-recursion-detection-logic

Conversation

@KUNDAN1334
Copy link
Copy Markdown
Contributor

@KUNDAN1334 KUNDAN1334 commented Apr 27, 2026

Description

This PR adds test cases for recursion detection in jsonFieldToSchema as requested in #1242.

The existing tests in library/src/helpers/__tests__/schema.test.ts covered basic transformations but had no coverage for recursion scenarios introduced in #1101 and #1241.

Test cases added inside describe('.jsonToSchema'):

Related issue(s)

Closes #1242

Note: The tests should NOT throw when the same object is referenced in two sibling branches and should NOT throw when the same object appears in multiple array positions are expected to fail on current master until #1241 is merged. They are intentionally written to validate the fix introduced in #1241.

@catosaurusrex2003 catosaurusrex2003 self-requested a review as a code owner May 2, 2026 13:50
@catosaurusrex2003
Copy link
Copy Markdown
Collaborator

@KUNDAN1334 nice work, the tests are passing now,
It is failing on Linting tho.
Could you please fix those issues when you get a chance?

@KUNDAN1334
Copy link
Copy Markdown
Contributor Author

@catosaurusrex2003 Thanks for the review! I'll fix the linting issues shortly.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 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.

Add test cases for recursion

2 participants