Skip to content

Commit

Permalink
[strimzi#434] feat: added create topic endpoint - openapiv2.json edit…
Browse files Browse the repository at this point in the history
…s and tests

Signed-off-by: ilkerkocatepe <[email protected]>
  • Loading branch information
ilkerkocatepe committed Nov 19, 2024
1 parent b17bf93 commit 06f50ae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/main/resources/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,48 @@
}
]
},
"/create-topic/{topicname}": {
"post": {
"tags": [
"Topics"
],
"description": "Creates a topic with given topic name.",
"operationId": "createTopic",
"responses": {
"200": {
"description": "Topic metadata",
"schema": {
"$ref": "#/definitions/TopicMetadata"
}
},
"404": {
"description": "The specified topic was not found.",
"schema": {
"$ref": "#/definitions/Error"
},
"examples": {
"response": {
"value": {
"error_code": 404,
"message": "The specified topic was not found."
}
}
}
}
}
},
"parameters": [
{
"name": "topicname",
"in": "path",
"description": "Name of the topic to send records to or retrieve metadata from.",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"/consumers/{groupid}/instances/{name}/records": {
"get": {
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ void openapiTest(VertxTestContext context) {
assertThat(paths.containsKey("/topics/{topicname}/partitions/{partitionid}/offsets"), is(true));
assertThat(paths.containsKey("/topics/{topicname}/partitions"), is(true));
assertThat(bridgeResponse.getJsonObject("paths").getJsonObject("/topics/{topicname}/partitions/{partitionid}").getJsonObject("post").getString("operationId"), is(HttpOpenApiOperations.SEND_TO_PARTITION.toString()));
assertThat(paths.containsKey("/create-topic/{topicname}"), is(true));
assertThat(bridgeResponse.getJsonObject("paths").getJsonObject("/create-topic/{topicname}").getJsonObject("post").getString("operationId"), is(HttpOpenApiOperations.CREATE_TOPIC.toString()));
assertThat(paths.containsKey("/healthy"), is(true));
assertThat(bridgeResponse.getJsonObject("paths").getJsonObject("/healthy").getJsonObject("get").getString("operationId"), is(HttpOpenApiOperations.HEALTHY.toString()));
assertThat(paths.containsKey("/ready"), is(true));
Expand Down

0 comments on commit 06f50ae

Please sign in to comment.