Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
verve111 opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@verve111
Copy link

verve111 commented Jan 9, 2025

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant