-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
good first issueGood for newcomersGood for newcomersnew featureNew feature or requestNew feature or request
Description
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
}
}
}
]
}
JSF Config:
const { fields, handleValidation } = createHeadlessForm(Schema, {
inputTypes: {
errorMessage: {
required: 'This cannot be empty.',
},
},
});
This is very important to be able to i18n in the application
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersnew featureNew feature or requestNew feature or request