Skip to content

Commit

Permalink
Request gets matched to resource correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
DDH13 committed Mar 8, 2024
1 parent fb45bd0 commit 6fd3c38
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ public byte[] getAPIDefinition(final String basePath, final String version, fina

public ResourceConfig getMatchedResource(API api, String matchedResourcePath, String method) {
List<ResourceConfig> resourceConfigList = api.getAPIConfig().getResources();
if (APIConstants.ApiType.GRPC.equals(api.getAPIConfig().getApiType())) {
//TODO check if there's another way to do this, perhaps in the adapter side by setting the method
return resourceConfigList.stream()
.filter(resourceConfig -> resourceConfig.getPath().equals(matchedResourcePath))
.findFirst().orElse(null);
}
return resourceConfigList.stream()
.filter(resourceConfig -> resourceConfig.getPath().equals(matchedResourcePath)).
filter(resourceConfig -> (method == null) || resourceConfig.getMethod()
Expand Down

0 comments on commit 6fd3c38

Please sign in to comment.