Skip to content

Ensure extended validators can create keywords which override exception messages #1134

Open
@ppaslan

Description

@ppaslan

Hi, first of all, thanks for all your work with this package.

All in all i think it works great and really does what it should and is supposed to do.
I think that if i should mention anything that i think could be better it would probably be better error messages, now i do understand that it is really hard to generate good error messages for all use cases but something that could be very useful is the option to add custom error messages.

Here is an example.

{
    "type": "object",
    "properties": {
        "templates": {
            "type": "object",
            "properties": {
                   "path": {"type": "string", "minLength": 1, "pattern": "^(/[^/]+)+$", "message": {"pattern": "You must use a valid full path with no trailing slashes"}}},
            "required": ["path"],
        },
    },
    "required": ["templates"],
}

I've read the documentation and haven't been able to find a way to define custom messages in the schema, but maybe i have missed something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dialects v2Issues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions