File tree Expand file tree Collapse file tree
src/main/java/flipnote/user/global/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package flipnote .user .global .config ;
22
3+ import flipnote .user .global .constants .HttpConstants ;
34import io .swagger .v3 .oas .models .OpenAPI ;
45import io .swagger .v3 .oas .models .info .Info ;
6+ import io .swagger .v3 .oas .models .servers .Server ;
7+ import org .springdoc .core .customizers .OperationCustomizer ;
58import org .springframework .context .annotation .Bean ;
69import org .springframework .context .annotation .Configuration ;
710
11+ import java .util .List ;
12+
813@ Configuration
914public class SwaggerConfig {
1015
@@ -14,6 +19,21 @@ public OpenAPI openAPI() {
1419 .info (new Info ()
1520 .title ("FlipNote User/Auth API" )
1621 .description ("FlipNote User/Auth API" )
17- .version ("1.0.0" ));
22+ .version ("1.0.0" ))
23+ .servers (List .of (
24+ new Server ().url ("https://api3.flipnote.site" ).description ("Production" ),
25+ new Server ().url ("http://localhost:8081" ).description ("Local" )
26+ ));
27+ }
28+
29+ @ Bean
30+ public OperationCustomizer hideInternalHeaders () {
31+ return (operation , handlerMethod ) -> {
32+ if (operation .getParameters () != null ) {
33+ operation .getParameters ().removeIf (p ->
34+ HttpConstants .USER_ID_HEADER .equals (p .getName ()));
35+ }
36+ return operation ;
37+ };
1838 }
1939}
You can’t perform that action at this time.
0 commit comments