From ec1528cef8b8ba508ee39cf51b43dc49c8a702f5 Mon Sep 17 00:00:00 2001 From: Jonathan Christison Date: Tue, 25 Jul 2023 19:45:50 +0100 Subject: [PATCH] Try defining openapi defintion on app --- .../v1alpha1/OshWrapperApiApplication.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/java/com/redhat/pctsec/rest/v1alpha1/OshWrapperApiApplication.java diff --git a/src/main/java/com/redhat/pctsec/rest/v1alpha1/OshWrapperApiApplication.java b/src/main/java/com/redhat/pctsec/rest/v1alpha1/OshWrapperApiApplication.java new file mode 100644 index 0000000..9347503 --- /dev/null +++ b/src/main/java/com/redhat/pctsec/rest/v1alpha1/OshWrapperApiApplication.java @@ -0,0 +1,49 @@ +package com.redhat.pctsec.rest.v1alpha1; +import jakarta.ws.rs.core.Application; +import org.eclipse.microprofile.openapi.annotations.Components; +import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; +import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType; +import org.eclipse.microprofile.openapi.annotations.info.Contact; +import org.eclipse.microprofile.openapi.annotations.info.Info; +import org.eclipse.microprofile.openapi.annotations.info.License; +import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; +import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme; +import org.eclipse.microprofile.openapi.annotations.tags.Tag; + +@OpenAPIDefinition( + tags = { + //@Tag(name="widget", description="Widget operations."), + //@Tag(name="gasket", description="Operations related to gaskets") + }, + info = @Info( + title="Example API", + version = "1.0.1", + contact = @Contact( + name = "Example API Support", + url = "http://exampleurl.com/contact", + email = "techsupport@example.com"), + license = @License( + name = "Apache 2.0", + url = "https://www.apache.org/licenses/LICENSE-2.0.html")), + components = @Components( + securitySchemes = { + @SecurityScheme( + securitySchemeName = "Kerberos", + type = SecuritySchemeType.HTTP, + scheme = "Negotiate" + //bearerFormat = "JWT" + ), + @SecurityScheme( + securitySchemeName = "basic", + type = SecuritySchemeType.HTTP, + scheme = "basic" + ) + } +), + security = { + @SecurityRequirement(name = "Kerberos"), + @SecurityRequirement(name = "basic") + } +) +public class OshWrapperApiApplication extends Application { +}