From 947339d937331c67d84306c9b1a030d45f8e825a Mon Sep 17 00:00:00 2001 From: mikera Date: Tue, 5 Nov 2024 13:00:16 +0000 Subject: [PATCH] RESTServer minor edits --- .../src/main/java/convex/restapi/RESTServer.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/convex-restapi/src/main/java/convex/restapi/RESTServer.java b/convex-restapi/src/main/java/convex/restapi/RESTServer.java index e458fdf86..c57660139 100644 --- a/convex-restapi/src/main/java/convex/restapi/RESTServer.java +++ b/convex-restapi/src/main/java/convex/restapi/RESTServer.java @@ -5,6 +5,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; +import java.util.function.Consumer; import org.eclipse.jetty.server.ServerConnector; import org.slf4j.Logger; @@ -31,6 +32,8 @@ import io.javalin.http.staticfiles.Location; import io.javalin.openapi.JsonSchemaLoader; import io.javalin.openapi.JsonSchemaResource; +import io.javalin.openapi.OpenApiInfo; +import io.javalin.openapi.plugin.DefinitionConfiguration; import io.javalin.openapi.plugin.OpenApiPlugin; import io.javalin.openapi.plugin.redoc.ReDocPlugin; import io.javalin.openapi.plugin.swagger.SwaggerPlugin; @@ -124,14 +127,15 @@ protected void addOpenApiPlugins(JavalinConfig config) { String docsPath="openapi-plugin/openapi-default.json"; config.registerPlugin(new OpenApiPlugin(pluginConfig -> { - pluginConfig .withDocumentationPath(docsPath) .withDefinitionConfiguration((version, definition) -> { - definition.withInfo(info -> { - info.setTitle("Convex REST API"); - info.setVersion("0.7.0"); - }); + DefinitionConfiguration def=definition; + def=def.withInfo((Consumer ) + info -> { + info.setTitle("Convex REST API"); + info.setVersion("0.7.0"); + }); }); }));