@@ -29,36 +29,41 @@ public class OpenAPIDocsConfiguration {
29
29
30
30
@ Bean
31
31
OpenAPI customizeOpenAPI () {
32
+
32
33
final String securitySchemeName = commonConfig .getCookieName ();
34
+
33
35
return new OpenAPI ()
34
36
.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()
38
40
.url(createLocalServerUrl("localhost", serverPort, contextPath))
39
41
.description("Local development API service")
40
- )
42
+ ) */
41
43
.addServersItem (createCustomServer ())
42
44
.addServersItem (new Server ()
43
45
.url ("https://api-service.lowcoder.cloud/" )
44
46
.description ("Lowcoder Community Edition: Public Cloud API Access" )
45
47
)
46
48
.addSecurityItem (new SecurityRequirement ()
47
49
.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
+ ) */
48
58
.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 )
60
64
.scheme ("bearer" )
61
65
.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...'" )
62
67
)
63
68
);
64
69
}
0 commit comments