Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Access] select option in rest api causes invalid results #6300

Conversation

UlyanaAndrukhiv
Copy link
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv commented Aug 7, 2024

Closes: #6056

Context

The issue in the select option for REST API calls was that the first result always returned as empty when the select key was the object with nested fields. Additionally, in such cases, other results after first were not filtered.

For example, the following case was not handled properly:

  • full response: { "a": 1, "b": {"c":2, "d":3}},
  • select=b,
  • expected response after filtered: { "b": {"c":2, "d":3}}.

This PR updates how the select filter for REST API calls works in these scenarios and adds more functional tests to ensure proper functionality.

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 41.48%. Comparing base (f4e316a) to head (7979b5a).

Files Patch % Lines
engine/access/rest/util/select_filter.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6300      +/-   ##
==========================================
- Coverage   41.49%   41.48%   -0.01%     
==========================================
  Files        2009     2009              
  Lines      143172   143175       +3     
==========================================
- Hits        59403    59398       -5     
- Misses      77587    77591       +4     
- Partials     6182     6186       +4     
Flag Coverage Δ
unittests 41.48% <75.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@peterargue
Copy link
Contributor

please add an explanation of what the bug was and how you fixed it to the PR description

Copy link
Contributor

@Guitarheroua Guitarheroua left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@Guitarheroua Guitarheroua added this pull request to the merge queue Aug 9, 2024
Merged via the queue into onflow:master with commit 610abde Aug 9, 2024
55 checks passed
@Guitarheroua Guitarheroua deleted the UlyanaAndrukhiv/6056-rest-select-option-bug branch August 9, 2024 12:33
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.

[Access] select option in rest api causes invalid results
4 participants