aditya-gupta36 commented on code in PR #373: URL: https://github.com/apache/atlas/pull/373#discussion_r2199931094
########## webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java: ########## @@ -892,27 +892,47 @@ private void validateSearchParameters(SearchParameters parameters) throws AtlasB private void validateEntityFilter(SearchParameters parameters) throws AtlasBaseException { FilterCriteria entityFilter = parameters.getEntityFilters(); + FilterCriteria tagFilter = parameters.getTagFilters(); - if (entityFilter == null) { - return; + if (checkEmptyFilterCriteria(entityFilter) ) { + validateNestedCriteria(entityFilter); } - if (entityFilter.getCriterion() != null && - !entityFilter.getCriterion().isEmpty()) { - if (entityFilter.getCondition() == null || StringUtils.isEmpty(entityFilter.getCondition().toString())) { + if (checkEmptyFilterCriteria(tagFilter)) { + validateNestedCriteria(tagFilter); + } + } + + private boolean checkEmptyFilterCriteria(FilterCriteria criteria) { Review Comment: Example of Request which substantiates the above changes: curl 'http://ccycloud-1.fsknox.root.comops.site:31000/api/atlas/v2/search/basic' \ -X POST \ -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0' \ -H 'Accept: application/json, text/javascript, */*; q=0.01' \ -H 'Accept-Language: en-US,en;q=0.5' \ -H 'Accept-Encoding: gzip, deflate' \ -H 'Content-Type: application/json' \ -H 'X-XSRF-HEADER: EEQgZd00cPbAAJZZr9zA' \ -H 'X-Requested-With: XMLHttpRequest' \ -H 'Origin: http://ccycloud-1.fsknox.root.comops.site:31000' \ -H 'Connection: keep-alive' \ -H 'Referer: http://ccycloud-1.fsknox.root.comops.site:31000/index.html' \ -H 'Cookie: SESSION=NDhlYWU2YmYtNTc4OC00NTVlLWI3MmEtNTk1MzY5MjgzZGJl; ATLASSESSIONID=node0p7tci3nip451oc6i1u75z6h7.node0' \ --data-raw '{ "excludeDeletedEntities": true, "includeSubClassifications": true, "includeSubTypes": true, "includeClassificationAttributes": true, "entityFilters": null, "tagFilters": { "condition": "AND", "criterion": [ { "attributeName": "__timestamp", "operator": "eq", "attributeValue": "1752219388000" }, { "condition": "AND", "criterion": [] } ] }, "attributes": [], "limit": 25, "offset": 0, "typeName": null, "classification": "_ALL_CLASSIFICATION_TYPES", "termName": null }' \ --insecure Above "criterion" : [] -> intentionally put empty -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@atlas.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org