Skip to content

Commit 6360973

Browse files
committed
TCK: Don't assume every Media Type has a schema
It's valid for a Content object, which represents the content for a Media Type, not to have a schema, so the filter TCK test should not call methods on it without checking whether it's present first.
1 parent 591909d commit 6360973

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tck/src/main/java/org/eclipse/microprofile/openapi/filter/AirlinesOASFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public APIResponse filterAPIResponse(APIResponse apiResponse) {
128128
if (content != null) {
129129
if (content.hasMediaType("application/json")) {
130130
Schema schema = content.getMediaType("application/json").getSchema();
131-
if ("child - id of the new review".equals(schema.getDescription())) {
131+
if (schema != null && "child - id of the new review".equals(schema.getDescription())) {
132132
schema.setDescription("parent - id of the new review");
133133
}
134134
}

0 commit comments

Comments
 (0)