oas 3.1 - adding sibling for pathItem,response,parameter,example,requestBody,Header,SecurityScheme,Link
@@ -1513,7 +1513,12 @@ public class OpenAPIDeserializer {
} else {
link.set$ref(ref.textValue());
}
-
+ if (result.isOpenapi31()) {
+ String desc = getString("description", linkNode, false, location, result);
+ if (StringUtils.isNotBlank(desc)) {
+ link.setDescription(desc);
+ }
+ }
return link;
} else {
result.invalidType(location, "$ref", "string", linkNode);
@@ -2088,6 +2093,12 @@ public class OpenAPIDeserializer {
} else {
header.set$ref(ref.textValue());
}
+ if (result.isOpenapi31()) {
+ String desc = getString("description", headerNode, false, location, result);
+ if (StringUtils.isNotBlank(desc)) {
+ header.setDescription(desc);
+ }
+ }
return header;
} else {
result.invalidType(location, "$ref", "string", headerNode);
@@ -2162,6 +2173,7 @@ public class OpenAPIDeserializer {
public Object getAnyExample(String nodeKey, ObjectNode node, String location, ParseResult result) {
+ //TODO: Examples now allows Ref
JsonNode example = node.get(nodeKey);
if (example != null) {
if (example.getNodeType().equals(JsonNodeType.STRING)) {
@@ -2246,6 +2258,12 @@ public class OpenAPIDeserializer {
} else {
securityScheme.set$ref(ref.textValue());
}
+ if (result.isOpenapi31()) {
+ String desc = getString("description", node, false, location, result);
+ if (StringUtils.isNotBlank(desc)) {
+ securityScheme.setDescription(desc);
+ }
+ }
return securityScheme;
} else {
result.invalidType(location, "$ref", "string", node);
@@ -3119,6 +3137,18 @@ public class OpenAPIDeserializer {
} else {
example.set$ref(ref.textValue());
}
+ if (result.isOpenapi31()) {
+ String desc = getString("summary", node, false, location, result);
+ if (StringUtils.isNotBlank(desc)) {
+ example.setSummary(desc);
+ }
+ }
+ if (result.isOpenapi31()) {
+ String desc = getString("description", node, false, location, result);
+ if (StringUtils.isNotBlank(desc)) {
+ example.setDescription(desc);
+ }
+ }
return example;
} else {
result.invalidType(location, "$ref", "string", node);
@@ -3248,6 +3278,13 @@ public class OpenAPIDeserializer {
} else {
apiResponse.set$ref(ref.textValue());
}
+ if(result.isOpenapi31()){
+ String value = getString("summary", node, false, location, result);
+ value = getString("description", node, false, location, result);
+ if (StringUtils.isNotBlank(value)) {
+ apiResponse.setDescription(value);
+ }
+ }
return apiResponse;
} else {
result.invalidType(location, "$ref", "string", node);
@@ -3495,6 +3532,12 @@ public class OpenAPIDeserializer {
} else {
body.set$ref(ref.textValue());
}
+ if (result.isOpenapi31()) {
+ String desc = getString("description", node, false, location, result);
+ if (StringUtils.isNotBlank(desc)) {
+ body.setDescription(desc);
+ }
+ }
return body;
} else {
result.invalidType(location, "$ref", "string", node);
