Given the following JSON Schema, I cannot override errorMessage using createHeadlessForm()
{
"type": "object",
"additionalProperties": false,
"properties": {
"browsers": {
"title": "Browsers (solo)",
"description": "This solo select also includes a disabled option.",
"type": "string",
"oneOf": [
{
"const": "chr",
"title": "Chrome"
},
{
"const": "ff",
"title": "Firefox"
},
{
"const": "ie",
"title": "Internet Explorer",
"disabled": true
}
],
"x-jsf-presentation": {
"inputType": "select"
}
},
"has_pet": {
"title": "Has Pet",
"description": "Do you have a pet?",
"oneOf": [
{
"title": "Yes",
"const": "yes"
},
{
"title": "No",
"const": "no"
}
],
"x-jsf-presentation": {
"inputType": "radio"
},
"type": "string"
},
"pet_name": {
"title": "Pet's name",
"description": "What's your pet's name?",
"x-jsf-presentation": {
"inputType": "text"
},
"type": "string",
"errorMessage": "string"
}
},
"required": ["has_pet"],
"x-jsf-order": ["has_pet", "pet_name"],
"allOf": [
{
"if": {
"properties": {
"has_pet": {
"const": "yes"
}
},
"required": ["has_pet"]
},
"then": {
"required": ["pet_name"]
},
"else": {
"properties": {
"pet_name": false
}
}
}
]
}
const { fields, handleValidation } = createHeadlessForm(Schema, {
inputTypes: {
errorMessage: {
required: 'This cannot be empty.',
},
},
});
Given the following JSON Schema, I cannot override errorMessage using createHeadlessForm()
JSF Config:
This is very important to be able to i18n in the application