perfsonar / perfsonar/pscompose
Handle custom invalid message when validating forms
Open
@jkafader-esnet is already working on this.
Since Jun 2, 2026.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Currently, I have this
"slip": {
"type": "string",
"title": "Slip",
'pattern': '^P(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$',
"description": "ISO 8601 Duration that allows the start of each run to be as much as the Duration later than their ideal scheduled time. Default is 5 minutes (PT5M)",
"default": "PT5M",
},
If i want to add a key such as x-invalid-message: "'%s' is not a valid ISO 8601 duration.", the frontend ignores the validation entirely. It's probably because AJV rejects any unknown keywords in strict mode, breaking all validation.
Perhaps, we'll have to update json-forms-esm and do something like
import { createAjv } from "@jsonforms/core";
const handleDefaultsAjv = createAjv({ useDefaults: true });
handleDefaultsAjv.addKeyword({ keyword: "x-invalid-message" });
Doing this, would then allow us to show better invalid messages to the user.
Currently, in the above case, the UI shows
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.