You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a field named confirmPassword, which has its ui:title set to "Confirm Password".
I want to have a custom errorTransformer which does a bit of dynamic composition.
It should change the error message and append the title at the end, nothing special.
The problem is that I cannot easily retrieve the ui:title from the RJSFValidationError object:
Notice how the ui:title is only present in the message and stack properties, without an easy way to dynamically extract it for composing other error messages.
Describe the solution you'd like
The most straightforward solution would be to add a new field to RJSFValidationError named title, which takes the property's title value from either the JSON Schema title or the UI Schema ui:title (with ui:title taking precedence over title maybe?).
Alternatively, adding an entire uiOptions field containing the corresponding ui:options (like returned by getUiOptions) for the property would cover even more use cases than exposing just the title.
Describe alternatives you've considered
I have tinkered around with getUiOptions, but dynamically accessing the property given how they are not always standardized in the property field (sometimes the property name is preceded by a dot, sometimes not) proved a great hassle.
The text was updated successfully, but these errors were encountered:
@TheOneTheOnlyJJ we are open to you making these changes in the rjsf-v6 branch. Adding title: string to the RJSFValidationError object and updating the transformRJSFValidationErrors() to return it seems rather straight forward.
Feel free to add a PR for this merging into the rjsf-v6 branch.
Prerequisites
What theme are you using?
mui
Is your feature request related to a problem? Please describe.
I have a field named
confirmPassword
, which has itsui:title
set to"Confirm Password"
.I want to have a custom
errorTransformer
which does a bit of dynamic composition.It should change the error message and append the title at the end, nothing special.
The problem is that I cannot easily retrieve the
ui:title
from theRJSFValidationError
object:Notice how the
ui:title
is only present in themessage
andstack
properties, without an easy way to dynamically extract it for composing other error messages.Describe the solution you'd like
The most straightforward solution would be to add a new field to
RJSFValidationError
namedtitle
, which takes the property'stitle
value from either the JSON Schematitle
or the UI Schemaui:title
(withui:title
taking precedence overtitle
maybe?).Alternatively, adding an entire
uiOptions
field containing the correspondingui:options
(like returned bygetUiOptions
) for the property would cover even more use cases than exposing just thetitle
.Describe alternatives you've considered
I have tinkered around with
getUiOptions
, but dynamically accessing the property given how they are not always standardized in theproperty
field (sometimes the property name is preceded by a dot, sometimes not) proved a great hassle.The text was updated successfully, but these errors were encountered: