Skip to content

ATLAS-5053: Add recursive validation in Basic Search API to fix regression issue#373

Merged
pinal-shah merged 1 commit intoapache:masterfrom
aditya-gupta36:ATLAS-5053
Jul 15, 2025
Merged

ATLAS-5053: Add recursive validation in Basic Search API to fix regression issue#373
pinal-shah merged 1 commit intoapache:masterfrom
aditya-gupta36:ATLAS-5053

Conversation

@aditya-gupta36
Copy link
Copy Markdown
Contributor

@aditya-gupta36 aditya-gupta36 commented Jun 5, 2025

What changes were proposed in this pull request?

  • Initially under basic and classification search, only basic [Add filter] option on UI, validation was done. Also, for [Add Group FIlter]option on UI it was throwing exception and errors.
  • So in this PR we have fixed that issue and we have handled filter search validation for both basic and complex filter groups.
  • Group FIlter - it recursively calls Filter SearchParameters. eg: In FilterCriteria class we have List criterion, so entityFilters attribute in SearchParametrs class recursively calls criterion in itself multiple times.
  • Apart have added TC to test negative scenarios for quick search and basic search

Conclusion:

"entityFilters": {

"condition": "AND",
"criterion": [
  {
    "attributeName": "__classificationNames",
    "operator": "eq",
    "attributeValue": "GameCatA"
  },
  {
    "condition": "AND",
    "criterion": [
      {
        "attributeName": "year_held",
        "operator": "eq",
        "attributeValue": "2006"
      }
    ]
  }
]

},
"tagFilters": null,
"attributes": [
"__classificationNames",
"__typeName",
"year_held"
],
"limit": 25,
"offset": 0,
"typeName": "tournament",
"classification": null,
"termName": null
}

  • As one can see, inside entity filter, we have criterion which in itself has condition and criterion i.e following nested pattern[recursively filtered], si in such case it gives:
    {
    "errorCode": "ATLAS-400-00-103",
    "errorMessage": "Invalid operator specified for attribute: null"
    }

So we have fixed this Complex filter validation[i.e. Add Filter Group Option]. Earlier it was only able to handle basic filter[i.e. normal Add Filter Option]

How was this patch tested?

Copy link
Copy Markdown
Contributor

@pareshddevalia pareshddevalia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@pareshddevalia pareshddevalia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pinal-shah pinal-shah merged commit cb1e53a into apache:master Jul 15, 2025
1 check passed
asf-gitbox-commits pushed a commit that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants