Skip to content

Commit

Permalink
Merge pull request #12334 from shnrndk/publisherSearchIssue
Browse files Browse the repository at this point in the history
Fix search API issue when APIs have spaces.
  • Loading branch information
shnrndk authored Mar 20, 2024
2 parents 00039b7 + 1275104 commit 24b3ffb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ private static Map<String, String> getSearchAttributes(String searchQuery) {
apiState = keyVal[1];
continue;
}
keyVal[1] = keyVal[1].replaceAll(" ", "&&");
attributes.put(keyVal[0], keyVal[1]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public class SearchApiServiceImpl implements SearchApiService {
public Response search(Integer limit, Integer offset, String query, String ifNoneMatch,
MessageContext messageContext) throws APIManagementException {
SearchResultListDTO resultListDTO = new SearchResultListDTO();
if (!query.equals(RestApiConstants.PIZZASHACK_SEARCH_QUERY) && (query.startsWith("name:") |
query.startsWith("description:"))) {
query = query.replaceAll(" ", "%20");
}

limit = limit != null ? limit : RestApiConstants.PAGINATION_LIMIT_DEFAULT;
offset = offset != null ? offset : RestApiConstants.PAGINATION_OFFSET_DEFAULT;
Expand Down

0 comments on commit 24b3ffb

Please sign in to comment.