Closed Dloadinghao closed 4 months ago
I don't really understand what you mean by set the value to the dimensions array.
If it helps the validation message contains the instanceNode
that the instanceLocation
points to. Note that if the keyword applies to an object
or array
the instanceNode
will then be the object
or array
. For example the required
and additionalProperties
keywords are going to be pointing to an object
.
I don't really understand what you mean by set the value to the dimensions array.
If it helps the validation message contains the
instanceNode
that theinstanceLocation
points to. Note that if the keyword applies to anobject
orarray
theinstanceNode
will then be theobject
orarray
. For example therequired
andadditionalProperties
keywords are going to be pointing to anobject
.
I 'm sorry, I 'm not good at English, which causes ambiguity in expression. For example, the name of the element with an index of 1 under the $.doc.schema query.dimensions group is server ip. I hope to display the value of server ip in the abnormal information, and the expected value is : $.doc.schema query.dimensions [ server_ip ]
The $.doc.schema_query.dimensions[1]
is the instanceLocation
where the error has occurred so I don't know what you mean by $.doc.schema_query.dimensions[server_ip]
. It would be clearer if you actually provided your schema, input data the actual message and what your expectations are, but it is unlikely that there is a built-in mechanism for what you want.
In this case you can get the value of $.doc.schema_query.dimensions[1]
from instanceNode
. If you want to incorporate the value into your message you will have to do some string manipulation of the message.
For example, my error message is : $.doc.schema _ query.dimensions [ 1 ] : xxxxxxxx, whether there is a built-in method to set the value of the index 1 directly returned to the dimensions array, rather than the specific index value.