Skip to content

Validation error collision when key contains dot (".") with AJV8 #3846

@rap1ds

Description

@rap1ds

Prerequisites

What theme are you using?

core

Version

5.12.1 (latest Playground)

Current Behavior

With AJV8, if a property key has a dot in it (e.g. Foo.Bar), there's a validation error collision with a Bar value inside Foo object.

Expected Behavior

There should not be collision. The behaviour should be the same as in AJV6 (deprecated)

Steps To Reproduce

Example 1

  1. Open Playground example
  2. Make sure AJV8 validator is selected
  3. Press submit

Expected:

  • Validation error "must NOT have fever than 5 characters" for value Foo
  • No validation error for value Bar

Actual:

  • Validation error "must NOT have fever than 5 characters" for value Foo
  • Validation error "must NOT have fever than 5 characters" for value Bar

Please note that if you select AJV6 (deprecated) validator, the behaviour is as expected

Example 2

(This example is the same as above but other way around)

  1. Open Playground example
  2. Make sure AJV8 validator is selected
  3. Press submit

Expected:

  • No validation error for value FooBar
  • Validation error "must NOT have fever than 2 characters" for value B

Actual:

  • Validation error "must NOT have fever than 2 characters" for value FooBar
  • Validation error "must NOT have fever than 2 characters" for value B

Please note: This issue happens ALSO with AJV6

Environment

- I'm using Playground, which afaik is using version 5.12.1. 
- MacOS
- Google Chrome 116.0.5845.110 (Official Build) (arm64)

Anything else?

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions