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 Sep 20, 2023
1 parent 7d9b72b commit 775315f
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);

Check warning on line 568 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java#L567-L568

Added lines #L567 - L568 were not covered by tests
}

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();

Check warning on line 640 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java#L640

Added line #L640 was not covered by tests
if (ref != null) {
addToReferenceObjectMap(ref, context);

Check warning on line 642 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java#L642

Added line #L642 was not covered by tests
}
}
}
}
Expand Down

0 comments on commit 775315f

Please sign in to comment.