jsonschemareact-jsonschema-forms

Apply multiple format rules to a single rjsf field


I like the rjsf format api, it works great for me:

"format": "alphanumeric"

But I would like to assign multiple format rules to a single field, and use transformErrors api to display a different message for each, giving user more precise feedback about what's wrong. Something along the lines of:

"format": ["alphanumeric", "mustBeginWithLetter"]

but this array notation doesn't work and breaks the formatting instead :)

Is there a clean way to achieve what I want?


Solution

  • "allOf": [ {"format": "alphanumeric"}, {"format": "mustBeginWithLetter"} ]