Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SWAGGER_X_AMZN_RESOURCE_CONTNET_ENCODED only if ARN is present #12160

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -930,12 +930,14 @@
// AWS Lambda: set arn & timeout to swagger
if (resource.getAmznResourceName() != null) {
operation.setVendorExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_NAME, resource.getAmznResourceName());
if (resource.isAmznResourceContentEncoded()) {
operation.setVendorExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_CONTNET_ENCODED,
resource.isAmznResourceContentEncoded());

Check warning on line 935 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OAS2Parser.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/OAS2Parser.java#L934-L935

Added lines #L934 - L935 were not covered by tests
}
}
if (resource.getAmznResourceTimeout() != 0) {
operation.setVendorExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_TIMEOUT, resource.getAmznResourceTimeout());
}
operation.setVendorExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_CONTNET_ENCODED,
resource.isAmznResourceContentEncoded());

updateLegacyScopesFromOperation(resource, operation);
String oauth2SchemeKey = APIConstants.SWAGGER_APIM_DEFAULT_SECURITY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,10 @@
// AWS Lambda: set arn & timeout to swagger
if (resource.getAmznResourceName() != null) {
operation.addExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_NAME, resource.getAmznResourceName());
if (resource.isAmznResourceContentEncoded()) {
operation.addExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_CONTNET_ENCODED,
resource.isAmznResourceContentEncoded());

Check warning on line 1239 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OAS3Parser.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/OAS3Parser.java#L1238-L1239

Added lines #L1238 - L1239 were not covered by tests
}
}
if (resource.getAmznResourceTimeout() != 0) {
operation.addExtension(APIConstants.SWAGGER_X_AMZN_RESOURCE_TIMEOUT, resource.getAmznResourceTimeout());
Expand Down
Loading