File tree 2 files changed +23
-1
lines changed
java/bio/overture/maestro/app/infra/config
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 29
29
import bio .overture .maestro .app .infra .config .properties .PropertiesConfig ;
30
30
import bio .overture .maestro .domain .api .DomainApiConfig ;
31
31
import com .fasterxml .jackson .databind .ObjectMapper ;
32
+ import io .swagger .v3 .oas .models .OpenAPI ;
33
+ import io .swagger .v3 .oas .models .servers .Server ;
34
+ import org .springframework .beans .factory .annotation .Value ;
35
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
32
36
import org .springframework .context .annotation .Bean ;
33
37
import org .springframework .context .annotation .Configuration ;
34
38
import org .springframework .context .annotation .Import ;
35
39
import org .springframework .context .annotation .Primary ;
36
40
import org .springframework .web .reactive .function .client .WebClient ;
37
41
42
+ import java .util .List ;
43
+
38
44
/** Aggregates all configuration in one place */
39
45
@ Configuration
40
46
@ Import ({
@@ -97,4 +103,12 @@ class WebConfig {
97
103
public ObjectMapper objectMapper () {
98
104
return new ObjectMapper ();
99
105
}
106
+
107
+ @ Bean
108
+ @ ConditionalOnProperty (name = "springdoc.serverOverride.enabled" , havingValue = "true" )
109
+ public OpenAPI maestroOpenApi (@ Value ("${springdoc.serverOverride.value}" ) String serverOverride ) {
110
+ return new OpenAPI ()
111
+ .servers (List .of (new Server ().url (serverOverride )));
112
+ }
113
+
100
114
}
Original file line number Diff line number Diff line change @@ -172,5 +172,13 @@ spring:
172
172
maxAttempts : 1
173
173
174
174
springdoc :
175
+ # # The reason this was added to support reverse proxy url rewrites like: http://xyz.com/maestro
176
+ # # otherwise the swagger urls will not be sent to the correct url since swagger ui depends
177
+ # # on the server definition and springdoc needs forward headers to be enabled by spring
178
+ # # enabling forward headers in maestro caused it to conflict with disabling kafka
179
+ # # and forced an autoconfigure for kafka client.
180
+ serverOverride :
181
+ enabled : false
182
+ value : http://localhost:11235/custom
175
183
swagger-ui :
176
- path : /api-docs
184
+ path : /api-docs
You can’t perform that action at this time.
0 commit comments