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

Default value doesn't work with if-else and array #3869

Open
4 tasks done
OtterleyW opened this issue Sep 14, 2023 · 2 comments
Open
4 tasks done

Default value doesn't work with if-else and array #3869

OtterleyW opened this issue Sep 14, 2023 · 2 comments

Comments

@OtterleyW
Copy link

OtterleyW commented Sep 14, 2023

Prerequisites

What theme are you using?

core

Version

5.6.2

Current Behavior

If there's an object with keys "foo" and "bar" and when "foo" is true, "bar" should added with default value true. If the schema contains just this object, the default value is added. But if the object is wrapped in an array, the default is not added.

Expected Behavior

Also when the object is inside an array, the default should be added for the object.

Steps To Reproduce

Here's a schema for an object with keys "foo" and "bar" and when "foo" is true, "bar" is added with default value true. Works fine: Link to Playground

Here's the same schema, but wrapped in an array. Default doesn't work. Link to Playground

@OtterleyW OtterleyW added bug needs triage Initial label given, to be assigned correct labels and assigned labels Sep 14, 2023
@heath-freenome heath-freenome added help wanted and removed needs triage Initial label given, to be assigned correct labels and assigned labels Sep 15, 2023
@heath-freenome
Copy link
Member

@OtterleyW This is odd. Are you willing to try and provide a fix?

@wnameless
Copy link

Try to use ajv6 instead of ajv8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants