Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[taplo-common] fix infinite recursion with composed allOfs #644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunshowers
Copy link

@sunshowers sunshowers commented Aug 11, 2024

Hi there!

I was trying to write a schema for nextest's configuration, and I ran into a call stack exhaustion issue. It turned out to be because an allOf wasn't getting removed even though there was an attempt to do so, leading to infinite recursion.

I couldn't find any tests for schemas so I added some. Please let me know if I can rearrange this to your liking somehow, thanks!

(And once this is landed a release would be lovely -- this is a hard blocker for nextest's schema at the moment.)

schema
.as_object_mut()
.expect("schema is an object")
.remove("allOf");

let mut merged_all_of = Value::Object(serde_json::Map::default());

Copy link
Author

Choose a reason for hiding this comment

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

I noticed below in line 569, and above in line 512/518/525, that depth wasn't getting subtracted by 1. Is this expected? Naively I'd expect depth to be subtracted here.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, it looks like #353 is related.

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.

1 participant