Skip to content

Commit

Permalink
Merge pull request #330 from swagger-api/issue-329
Browse files Browse the repository at this point in the history
fixed NPE on adding content type extension
  • Loading branch information
HugoMario authored Mar 15, 2019
2 parents 88c0804 + e793f35 commit 23875f7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3770,7 +3770,9 @@ protected Schema getSchemaFromResponse(ApiResponse response) {
Schema schema = null;
for (String contentType : response.getContent().keySet()) {
schema = response.getContent().get(contentType).getSchema();
schema.addExtension("x-content-type", contentType);
if (schema != null) {
schema.addExtension("x-content-type", contentType);
}
break;
}
return schema;
Expand Down

0 comments on commit 23875f7

Please # to comment.