diff --git a/examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java b/examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java index cb03a79..62c37d4 100644 --- a/examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java +++ b/examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java @@ -3,10 +3,12 @@ import com.fasterxml.jackson.databind.node.TextNode; import io.javalin.Javalin; import io.javalin.http.Context; +import io.javalin.http.CreatedResponse; import io.javalin.http.Handler; import io.javalin.openapi.ApiKeyAuth; import io.javalin.openapi.BasicAuth; import io.javalin.openapi.BearerAuth; +import io.javalin.openapi.ClientCredentials; import io.javalin.openapi.CookieAuth; import io.javalin.openapi.Custom; import io.javalin.openapi.CustomAnnotation; @@ -113,7 +115,10 @@ public static void main(String[] args) { .withSecurityScheme("OAuth2", new OAuth2("This API uses OAuth 2 with the implicit grant flow.") .withFlow(new ImplicitFlow("https://api.example.com/oauth2/authorize") .withScope("read_pets", "read your pets") - .withScope("write_pets", "modify pets in your account"))) + .withScope("write_pets", "modify pets in your account") + ) + .withFlow(new ClientCredentials("https://api.example.com/credentials/authorize")) + ) .withGlobalSecurity(new Security("OAuth2") .withScope("write_pets") .withScope("read_pets")) diff --git a/openapi-specification/src/main/kotlin/io/javalin/openapi/Security.kt b/openapi-specification/src/main/kotlin/io/javalin/openapi/Security.kt index 59333ba..fb75bd9 100644 --- a/openapi-specification/src/main/kotlin/io/javalin/openapi/Security.kt +++ b/openapi-specification/src/main/kotlin/io/javalin/openapi/Security.kt @@ -89,5 +89,5 @@ class ClientCredentials @JvmOverloads constructor( val tokenUrl: String, override val scopes: MutableMap = mutableMapOf() ) : OAuth2Flow { - override val flowType: String = "clientCredentials " + override val flowType: String = "clientCredentials" } \ No newline at end of file diff --git a/wiki b/wiki index 5f13445..dfbbc8d 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 5f13445eed1d2c034accfab4c52f81cf37a9cf19 +Subproject commit dfbbc8d50817b276d7118ad4704347899e43fb28