Skip to content

OpenAPIV3Parser.resolve() should handle all errors in the entire spec #2149

Description

@verve111

Hi, currently we've faced the issue on our project:
OpenAPIV3Parser.resolve() is wrapped with the try-catch and when any error occurs within it, e.g. path is incorrect or a component is wrongly defined, the exception is thrown and caught by that try-catch (typical try-catch behaviour). In this way the spec validation stops and not proceeded to further paths and components:

private SwaggerParseResult resolve(SwaggerParseResult result, List<AuthorizationValue> auth, ParseOptions options,
        String location) {
    try {
    	// any exception here stops the spec parsing

    } catch (Exception e) {
        LOGGER.warn("Exception while resolving:", e);
        result.getMessages().add(e.getMessage());
    }
    return result;
}

It would be perfect to collect all such errors and not to get limited to a single one.
Please tell if it's possible,
Many thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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