Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ public void init(ServletConfig config) throws ServletException {
.openAPI(oas)
.resourceClasses(resourceClasses.stream().map(Class::getName).collect(Collectors.toSet()));

// Only register the configuration here. OpenApiResource builds its own child context from it
// and reads the spec on the first request; it never uses a read done here. Reading here would
// only warm up classes for that first request, at the cost of slower server startup.
try {
new ServletOpenApiContextBuilder()
.servletConfig(config)
.openApiConfiguration(oasConfig)
.buildContext(true)
.read();
.buildContext(true);
} catch (OpenApiConfigurationException e) {
logger.error("Failed to initialize Swagger servlet", e);
throw new ServletException(e.getMessage(), e);
Expand Down
Loading