@@ -13,8 +13,10 @@ import {
1313 type SchemaValue ,
1414} from "@sjsf/form/core" ;
1515import {
16+ computePseudoId ,
1617 DEFAULT_ID_PREFIX ,
1718 DEFAULT_ID_SEPARATOR ,
19+ DEFAULT_PSEUDO_ID_SEPARATOR ,
1820 pathToId ,
1921 type Config ,
2022 type FieldErrors ,
@@ -36,7 +38,8 @@ export class AjvValidator implements FormValidator<ErrorObject> {
3638 private readonly ajv : Ajv ,
3739 private readonly uiSchema : UiSchemaRoot = { } ,
3840 private readonly idPrefix : string = DEFAULT_ID_PREFIX ,
39- private readonly idSeparator : string = DEFAULT_ID_SEPARATOR
41+ private readonly idSeparator : string = DEFAULT_ID_SEPARATOR ,
42+ private readonly idPseudoSeparator : string = DEFAULT_PSEUDO_ID_SEPARATOR
4043 ) { }
4144
4245 reset ( ) {
@@ -148,13 +151,26 @@ export class AjvValidator implements FormValidator<ErrorObject> {
148151 }
149152
150153 private instancePathToId (
151- { params : { missingProperty } } : ErrorObject ,
154+ {
155+ params : { missingProperty, propertyName : propertyNameParam } ,
156+ propertyName = propertyNameParam ,
157+ } : ErrorObject ,
152158 path : string [ ]
153159 ) {
154- const id = pathToId ( this . idPrefix , this . idSeparator , path ) ;
155- return missingProperty !== undefined
156- ? `${ id } ${ this . idSeparator } ${ missingProperty } `
157- : id ;
160+ let id = pathToId ( this . idPrefix , this . idSeparator , path ) ;
161+ id =
162+ missingProperty !== undefined
163+ ? `${ id } ${ this . idSeparator } ${ missingProperty } `
164+ : id ;
165+ id =
166+ propertyName !== undefined
167+ ? computePseudoId (
168+ this . idPseudoSeparator ,
169+ `${ id } ${ this . idSeparator } ${ propertyName } ` ,
170+ "key-input"
171+ )
172+ : id ;
173+ return id ;
158174 }
159175
160176 private errorObjectToMessage (
0 commit comments