Making openapi json path configurable
@@ -40,10 +40,12 @@ public final class SwaggerToOpenApiConversionFilter implements ContainerRequestF
private static final String OPEN_API_PROPERTY = "openapi";
private OpenApiConfiguration openApiConfig;
+ private String openApiJsonPath = OPEN_API_PATH;
+
@Override
public void filter(ContainerRequestContext reqCtx) throws IOException {
String path = reqCtx.getUriInfo().getPath();
- if (path.endsWith(OPEN_API_PATH)) {
+ if (path.endsWith(openApiJsonPath)) {
reqCtx.setRequestUri(URI.create(SWAGGER_PATH));
reqCtx.setProperty(OPEN_API_PROPERTY, Boolean.TRUE);
}
@@ -68,4 +70,8 @@ public final class SwaggerToOpenApiConversionFilter implements ContainerRequestF
public void setOpenApiConfig(OpenApiConfiguration openApiConfig) {
this.openApiConfig = openApiConfig;
}
+
+ public void setOpenApiJsonPath(String openApiJsonPath) {
+ this.openApiJsonPath = openApiJsonPath;
+ }
}
