Skip to content

Support standard output formats #1008

Open
@flying-sheep

Description

@flying-sheep

The standard draft 2020-12 defines four standard output formats: https://json-schema.org/draft/2020-12/json-schema-core.html#name-output-formatting

  • Flag - A boolean which simply indicates the overall validation result with no further details.
  • Basic - Provides validation information in a flat list structure.
  • Detailed - Provides validation information in a condensed hierarchical structure based on the structure of the schema.
  • Verbose - Provides validation information in an uncondensed hierarchical structure that matches the exact structure of the schema.

jsonschema should provide ways to emit them and integrate them with its error structure:

  • there should be a Validator method with a format keyword argument that just emits a Python dict conforming to the chosen format
  • the ValidationErrors emitted by iter_errors should match the errors in the Basic format
  • the ErrorTree structure should match the Detailed/Verbose format

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dialects v2Issues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionalityError ReportingIssues related to clearer or more robust validation error reporting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions