Skip to content

Error message on patternProperties could be more informative #316

@itamarst

Description

@itamarst

Consider the following schema snippet:

     templates:
        type: object
        additionalProperties: false
        patternProperties:
          "^[a-zA-Z][-a-zA-Z0-9]{0,29}$":
            $ref: "#/definitions/docker-component"

If there is a key in the templates JSON object that doesn't match that regex the error message looks like this (I'm formatting this with error.path + error.message):

/templates: Additional properties are not allowed ("postgresql-v9'6" was unexpected)

This is not very informative to the reader. Here's my proposal for a better error message:

/templates: "postgresql-v9'6" does not match any of these regexs: ^[a-zA-Z][-a-zA-Z0-9]{0,29}$.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions