Skip to content

Commit 1d76d08

Browse files
committed
[strimzi#434] docs: edits after review
Signed-off-by: ilkerkocatepe <[email protected]>
1 parent d923836 commit 1d76d08

File tree

6 files changed

+13
-47
lines changed

6 files changed

+13
-47
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dff7d42e8ed3327a4f6bb31ee1538f2ce13654848528c99bade2fc1e218e4ee4
1+
77b5eaed68bedca82b8ad53a16e3841ac7b6ae62a1c16a3ea009d30cd49b768c

documentation/book/api/index.adoc

+1-6
Original file line numberDiff line numberDiff line change
@@ -2349,17 +2349,12 @@ Creates a topic with given name, partitions count and replication factor.
23492349
| Created
23502350
| <<>>
23512351

2352-
2353-
| 400
2354-
| Request body is null or it doesn&#39;t contain topic name.
2355-
| <<Error>>
2356-
23572352
|===
23582353

23592354
===== Samples
23602355

23612356

2362-
// markup not found, no include::{snippetDir}admin/topics/POST/http-request.adoc[opts=optional]
2357+
include::{snippetDir}admin/topics/POST/http-request.adoc[opts=optional]
23632358

23642359

23652360
// markup not found, no include::{snippetDir}admin/topics/POST/http-response.adoc[opts=optional]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
==== Example HTTP request
2+
3+
===== Request body
4+
[source,json]
5+
----
6+
{
7+
"topic_name" : "my-topic",
8+
"partitions_count" : 1,
9+
"replication_factor" : 2,
10+
}
11+
----

src/main/java/io/strimzi/kafka/bridge/http/HttpAdminBridgeEndpoint.java

-10
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,6 @@ public void doCreateTopic(RoutingContext routingContext) {
197197
return;
198198
}
199199

200-
if (jsonBody.getString("topic_name").isBlank()) {
201-
HttpBridgeError error = new HttpBridgeError(
202-
HttpResponseStatus.UNPROCESSABLE_ENTITY.code(),
203-
"Topic name must not be empty"
204-
);
205-
HttpUtils.sendResponse(routingContext, HttpResponseStatus.UNPROCESSABLE_ENTITY.code(),
206-
BridgeContentType.KAFKA_JSON, JsonUtils.jsonToBytes(error.toJson()));
207-
return;
208-
}
209-
210200
String topicName = jsonBody.getString("topic_name");
211201
Optional<Integer> partitionsCount = Optional.ofNullable(jsonBody.getInteger("partitions_count"));
212202
Optional<Short> replicationFactor = Optional.ofNullable(jsonBody.getInteger("replication_factor"))

src/main/resources/openapi.json

-18
Original file line numberDiff line numberDiff line change
@@ -777,24 +777,6 @@
777777
"content": {
778778
"application/vnd.kafka.v2+json": {}
779779
}
780-
},
781-
"400": {
782-
"description": "Request body is null or it doesn't contain topic name.",
783-
"content": {
784-
"application/vnd.kafka.v2+json": {
785-
"schema": {
786-
"$ref": "#/components/schemas/Error"
787-
},
788-
"examples": {
789-
"response": {
790-
"value": {
791-
"error_code": 400,
792-
"message": "Validation error on: - provided object should contain property topic_name"
793-
}
794-
}
795-
}
796-
}
797-
}
798780
}
799781
}
800782
}

src/main/resources/openapiv2.json

-12
Original file line numberDiff line numberDiff line change
@@ -713,18 +713,6 @@
713713
"201": {
714714
"description": "Created",
715715
"schema": {}
716-
},
717-
"400": {
718-
"description": "Request body is null or it doesn't contain topic name.",
719-
"schema": {
720-
"$ref": "#/definitions/Error"
721-
},
722-
"examples": {
723-
"application/vnd.kafka.v2+json": {
724-
"error_code": 400,
725-
"message": "Validation error on: - provided object should contain property topic_name"
726-
}
727-
}
728716
}
729717
}
730718
}

0 commit comments

Comments
 (0)