Skip to content

Option to not short circuit on validation errors #257

@zlozano

Description

@zlozano

Today the validation code in the openapi3filter package short circuits on the first error encountered. We have a use case where we would like to audit all fields that fail, and the reasons for which they failed. Opening this ticket in search of feedback and feasibility.

One way we might accomplish this is with a custom error type that tracks fields + reasons along with an option to enable this feature (similar to the fast flag, I'd imagine), e.g.

type MultiError struct {
    Issues map[string][]error // could be "fast" error or *SchemaError
}

func (me *MultiError) Error() string { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions