Skip to content

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented Apr 2, 2021

Fixes #6

The issue is mostly caused by the fact json-schema-merge-allof creates a object, and therefore processedFragments check is missed. This is why I resorted to relying on allOf rather than the whole fragment.
allOf itself is stable and not cloned.

On a side note - although I haven't measured the perf difference, I suppose we should see some gains in certain situations (such as more than a single $ref to the same allOf).

The current JSV (3.x.x) is also vulnerable to the same issue - it handles it worse than the new version of JSV (v4) will, as the current version just keeps populating the tree until it eventually fails (see the error in the console).

image

This is how it looks like when yalced in JSV v4.

image
image
image

Rows are collapsible now!

@P0lip P0lip added the bug Something isn't working label Apr 2, 2021
@P0lip P0lip self-assigned this Apr 2, 2021
@P0lip P0lip marked this pull request as ready for review April 2, 2021 13:57
@P0lip P0lip requested review from a team, billiegoose and paulatulis April 2, 2021 13:57
@P0lip P0lip enabled auto-merge (squash) April 6, 2021 07:31
@marcelltoth
Copy link
Contributor

Hey 👋 can I have the status of this? Is it only waiting for @paulatulis or @wmhilton 's review?

@P0lip
Copy link
Contributor Author

P0lip commented Apr 7, 2021

Yeah, it's only lacking a review.
I'm reallllly hoping someone gives this PR a shot today.
I'll ping my teammates again today.

Copy link
Contributor

@paulatulis paulatulis left a comment

Choose a reason for hiding this comment

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

I know my lack of understanding around what this all actually does is holding the entire team back, so I am going to go ahead and approve because it looks like the issue is solved by @P0lip's changes. That said, I would feel better if someone else on @stoplightio/void-crew could give it a pass as well. Apologies for the delay!

@P0lip P0lip merged commit 29fa570 into master Apr 7, 2021
@P0lip P0lip deleted the fix/walker/reuse-fragments branch April 7, 2021 11:44
@github-actions
Copy link

github-actions bot commented Apr 7, 2021

🎉 This PR is included in version 1.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

@billiegoose billiegoose left a comment

Choose a reason for hiding this comment

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

I mean, I still don't know what this does either but sure. It's got tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema with allOf + recursive refs crashes json-schema-tree
4 participants