Skip to content

Commit

Permalink
Remove inner class
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Valeri <[email protected]>
  • Loading branch information
fvaleri committed Feb 13, 2025
1 parent 3eef62c commit b15b1b8
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/main/java/io/strimzi/kafka/bridge/http/HttpBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,15 @@ public void process(RoutingContext routingContext) {
}
};

final HttpOpenApiOperation OPENAPIV2 = new NotSupportedApi(HttpOpenApiOperations.OPENAPIV2);
final static HttpOpenApiOperation OPENAPIV2 = new HttpOpenApiOperation(HttpOpenApiOperations.OPENAPIV2) {

@Override
public void process(RoutingContext routingContext) {
HttpBridgeError error = new HttpBridgeError(HttpResponseStatus.GONE.code(), "OpenAPI v2 Swagger not supported");
HttpUtils.sendResponse(routingContext, HttpResponseStatus.GONE.code(),
BridgeContentType.KAFKA_JSON, JsonUtils.jsonToBytes(error.toJson()));
}
};

final HttpOpenApiOperation OPENAPIV3 = new HttpOpenApiOperation(HttpOpenApiOperations.OPENAPIV3) {

Expand All @@ -849,17 +857,4 @@ public void process(RoutingContext routingContext) {
information(routingContext);
}
};

static class NotSupportedApi extends HttpOpenApiOperation {
public NotSupportedApi(HttpOpenApiOperations operationId) {
super(operationId);
}

@Override
public void process(RoutingContext routingContext) {
HttpBridgeError error = new HttpBridgeError(HttpResponseStatus.GONE.code(), "OpenAPI v2 Swagger not supported");
HttpUtils.sendResponse(routingContext, HttpResponseStatus.GONE.code(),
BridgeContentType.KAFKA_JSON, JsonUtils.jsonToBytes(error.toJson()));
}
}
}

0 comments on commit b15b1b8

Please sign in to comment.