Skip to content

validate_schema does not report regex errors #222

@eapache-opslevel

Description

@eapache-opslevel

Version 2.4.0.

Per #194 we have switched to using the class-based schema validation methods rather than the instance-based methods. But we have found a case where the class-based methods report the schema as valid:

(byebug) schema
{"type"=>"string", "pattern"=>"^[A-Za-z0-9_-\\s+]+$"}
(byebug) JSONSchemer.valid_schema?(schema)
true
(byebug) JSONSchemer.validate_schema(schema).to_a
[]
(byebug) JSONSchemer.schema(schema)
*** RegexpError Exception: char-class value at end of range: /^[A-Za-z0-9_-\s+]+$/

nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions