Skip to content

Errors for properties containing slashes are not properly matched #2146

@sdirix

Description

@sdirix

Describe the bug

Consider the following subschema:

"/work/email": {
  "title": "Email with slash",
  "description": "Email address With Slash",
  "type": "string",
  "format": "email"
}

The 'email' format error is not successfully matched to the property and therefore does not show up in the errors prop.

Expected behavior

The error should be matched to the property.

Steps to reproduce the issue

  1. Use the property posted above
  2. Observe that the UI will not show the error

Screenshots

No response

In which browser are you experiencing the issue?

n/a

Which Version of JSON Forms are you using?

3.0.0

Framework

Core

RendererSet

No response

Additional context

Reported in the community: https://jsonforms.discourse.group/t/ajv-issues-with-slashes-in-json-pointer/1418

A good fix for the error could be in the getControlPath method. The method is used to transform the JSON Pointer based path from AJV into the dot-notation of JSON Forms. However it does not decode escaped JSON Pointer sequences which is why the matching fails: '~1work~1email' === '/work/email'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions