Skip to content

Commit

Permalink
Merge pull request #12541 from RusJaI/empty-resource-check
Browse files Browse the repository at this point in the history
Fix empty resource paths not caught by the existing validation logic implementation
  • Loading branch information
RusJaI committed Sep 9, 2024
2 parents d7d2dca + 0f5fab1 commit 7529f86
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,10 @@ public APIDefinitionValidationResponse validateAPIDefinition(String apiDefinitio
// Which is a known issue of Swagger 2.0 parser
Set<URITemplate> uriTemplates = null;
uriTemplates = getURITemplates(apiDefinition);
if (uriTemplates == null) {
if (uriTemplates.size() == 0) {
validationResponse.setValid(false);
OASParserUtil.addErrorToValidationResponse(validationResponse,
"Empty resource paths found in the swagger definition");
return validationResponse;
} else {
for (URITemplate uriTemplate : uriTemplates) {
Expand Down

0 comments on commit 7529f86

Please sign in to comment.