@@ -29,36 +29,41 @@ public class OpenAPIDocsConfiguration {
2929
3030 @ Bean
3131 OpenAPI customizeOpenAPI () {
32+
3233 final String securitySchemeName = commonConfig .getCookieName ();
34+
3335 return new OpenAPI ()
3436 .info (new Info ()
35- .title ("Lowcoder API" )
36- .version (commonConfig .getApiVersion ()))
37- .addServersItem (new Server ()
37+ .title ("Lowcoder Open Rest API" )
38+ .version (commonConfig .getApiVersion ()))
39+ /* .addServersItem(new Server()
3840 .url(createLocalServerUrl("localhost", serverPort, contextPath))
3941 .description("Local development API service")
40- )
42+ ) */
4143 .addServersItem (createCustomServer ())
4244 .addServersItem (new Server ()
4345 .url ("https://api-service.lowcoder.cloud/" )
4446 .description ("Lowcoder Community Edition: Public Cloud API Access" )
4547 )
4648 .addSecurityItem (new SecurityRequirement ()
4749 .addList (securitySchemeName )).components (new Components ()
50+ /* .addSecuritySchemes(
51+ securitySchemeName,
52+ new SecurityScheme()
53+ .name(securitySchemeName)
54+ .type(SecurityScheme.Type.HTTP) // HTTP-based authentication
55+ .scheme("cookie") // Specify the authentication scheme as "cookie"
56+ .description("Cookie-based authentication. Please ensure the client sends cookies with each request after authentication.")
57+ ) */
4858 .addSecuritySchemes (
49- securitySchemeName ,
50- new SecurityScheme ()
51- .name (securitySchemeName )
52- .type (SecurityScheme .Type .APIKEY )
53- .in (SecurityScheme .In .COOKIE )
54- )
55- .addSecuritySchemes (
56- "API Key" ,
57- new SecurityScheme ()
58- .name ("API key" )
59- .type (SecurityScheme .Type .HTTP )
59+ "API Key" ,
60+ new SecurityScheme ()
61+ .name ("Authorization" )
62+ .type (SecurityScheme .Type .APIKEY )
63+ .in (SecurityScheme .In .HEADER )
6064 .scheme ("bearer" )
6165 .bearerFormat ("JWT" )
66+ .description ("API Key Authentication with a Bearer token. Copy your API Key and prefix it here with 'Bearer ' (e.g. 'Bearer eyJhbGciO...'" )
6267 )
6368 );
6469 }
0 commit comments