Skip to content

Commit

Permalink
Fixing error when adding yaml type policy file
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranyaKavishani committed Aug 2, 2024
1 parent 635e457 commit daad6fe
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2019,11 +2019,8 @@ public Response addAPISpecificOperationPolicy(String apiId, InputStream policySp
jsonContent = RestApiPublisherUtils.readInputStream(policySpecFileInputStream, policySpecFileDetail);

String fileName = policySpecFileDetail.getDataHandler().getName();
String fileContentType = FilenameUtils.getExtension(fileName);
if (org.apache.commons.lang3.StringUtils.isBlank(fileContentType)) {
fileContentType = policySpecFileDetail.getContentType().toString();
}
if (APIConstants.YAML_CONTENT_TYPE.equals(fileContentType)) {
if (fileName.endsWith(APIConstants.YAML_FILE_EXTENSION) ||
fileName.endsWith(APIConstants.YML_FILE_EXTENSION)) {
jsonContent = CommonUtil.yamlToJson(jsonContent);
}

Expand Down

0 comments on commit daad6fe

Please sign in to comment.