mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
[FIX][CLI] handle null result messages (#7472)
swagger-parser has the potential to return null for messages which will throw NPE on initialization of the validationMessages hashset. rather that allow this to happen we will assume that a null message collection represents an empty collection and continue. Fixes #7453
This commit is contained in:
@@ -518,7 +518,7 @@ public class CodegenConfigurator {
|
||||
SwaggerParseResult result = new OpenAPIParser().readLocation(inputSpec, authorizationValues, options);
|
||||
|
||||
// TODO: Move custom validations to a separate type as part of a "Workflow"
|
||||
Set<String> validationMessages = new HashSet<>(result.getMessages());
|
||||
Set<String> validationMessages = new HashSet<>(null != result.getMessages() ? result.getMessages() : new ArrayList<>());
|
||||
OpenAPI specification = result.getOpenAPI();
|
||||
// TODO: The line below could be removed when at least one of the issue below has been resolved.
|
||||
// https://github.com/swagger-api/swagger-parser/issues/1369
|
||||
|
||||
Reference in New Issue
Block a user