Skip to content

Commit 5a95d4b

Browse files
authored
Merge pull request #617 from benjamin-confino/585-test-for-no-response
Create a test for an operation without resources
2 parents 84260d2 + 799d15d commit 5a95d4b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tck/src/main/java/org/eclipse/microprofile/openapi/tck/AirlinesAppTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,14 @@ public void testStaticFileDefinitions(String type) {
10481048
vr.body(callbacksPath + ".responses.'204'.description",
10491049
both(containsString("Your server should return this HTTP status code if no longer interested"))
10501050
.and(containsString("in further updates")));
1051+
1052+
// Test an operation with no responses
1053+
String noResponsePath = "paths.'/streams'.get";
1054+
vr.body(noResponsePath + ".description", equalTo("An operation without a response"));
1055+
vr.body(noResponsePath + ".parameters[0].name", equalTo("callbackUrl"));
1056+
vr.body(noResponsePath + ".parameters[0].description",
1057+
equalTo("the location where data will be sent. Must be network accessible\n"
1058+
+ "by the source server\n"));
10511059
}
10521060

10531061
@Test(dataProvider = "formatProvider")

tck/src/main/resources/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ info:
1818
version: 1.0.0
1919
paths:
2020
/streams:
21+
get:
22+
description: An operation without a response
23+
parameters:
24+
- name: callbackUrl
25+
in: query
26+
required: true
27+
description: |
28+
the location where data will be sent. Must be network accessible
29+
by the source server
30+
schema:
31+
type: string
32+
format: uri
33+
examples:
34+
- https://tonys-server.com
2135
post:
2236
description: subscribes a client to receive out-of-band data
2337
parameters:

0 commit comments

Comments
 (0)