diff --git a/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java b/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java index 13ebe81a..4d70065e 100644 --- a/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java +++ b/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java @@ -170,7 +170,12 @@ protected void init(Configuration configuration) { } Map paths = openAPI.getPaths(); - Map definitions = openAPI.getComponents().getSchemas(); + Map definitions = null; + if (openAPI.getComponents() == null || openAPI.getComponents().getSchemas() == null) { + definitions = new HashMap<>(); + } else { + definitions = openAPI.getComponents().getSchemas(); + } for (String pathString : paths.keySet()) { PathItem pathItem = paths.get(pathString); final Resource.Builder builder = Resource.builder();