Skip to content

Commit

Permalink
Add missing references to api product swagger definition
Browse files Browse the repository at this point in the history
Add path level parameter references to api product swagger definition
Add response header references to api product swagger definition
  • Loading branch information
SavinduDimal committed Oct 13, 2023
1 parent 020c150 commit 6d91787
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ private static void readPathsAndScopes(PathItem srcPathItem, URITemplate uriTemp

PathItem pathItem = paths.get(uriTemplate.getUriTemplate());
pathItem.operation(httpMethod, srcOperation);
if (pathItem.getParameters() == null && srcPathItem.getParameters() != null) {
pathItem.setParameters(srcPathItem.getParameters());
setRefOfParameters(srcPathItem.getParameters(), context);
}

readReferenceObjects(srcOperation, context);

Expand Down Expand Up @@ -632,8 +636,11 @@ private static void setRefOfApiResponseHeaders(ApiResponses responses, SwaggerUp
if (headers != null) {
for (Header header : headers.values()) {
Content content = header.getContent();

extractReferenceFromContent(content, context);
String ref = header.get$ref();
if (ref != null) {
addToReferenceObjectMap(ref, context);
}
}
}
}
Expand Down

0 comments on commit 6d91787

Please sign in to comment.