Skip to content

provides validation result for more than SingleIssue? #38

Open

Description

Currentely validate(data, schema) only returns SingleIssue, even if there are more than 1 failure.

using JSON, JSONSchema
data = JSON.parse("""{
    "Title": null,
    "Desc": 15
}
""")

schema = JSON.parse("""{
    "properties": {
        "Title": {
            "type": "string"
        },
        "Desc": {
            "type": "string"
        }
    }
}
""")

JSONSchema.validate(data, Schema(schema))

But I'm trying to setup JSONSchema validation on github action with large and complex data. So, it's preferable to present all the issues from the sigle run.

How about adding validateall, which returns Array{SingleIssue, 1} for all the validations?

Activity

  1. odow commented on Sep 10, 2021

    @odow
    Collaborator

    This is a feature addition and non-breaking, so go for it.

    validateall

    How about instead of a new function, we add validate(schema, data; fail_fast::Bool = true)?

    Then you could run validate(schema, data; fail_fast = false) to return the vector of failures?

  2. yakir12 commented on May 30, 2026

    @yakir12

    This seems like a very useful feature (and exists in python's jsonschema). Any headway on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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