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

feat: handle multiple ResponseInfo obj in Query response #606

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

berezovskyi
Copy link
Member

Description

Allows Query responses to be paged even in presence of multiple ResponseInfo objects.

Checklist

  • This PR adds an entry to the CHANGELOG. See https://keepachangelog.com/en/1.0.0/ for instructions. Minor edits are exempt.
  • This PR was tested on at least one Lyo OSLC server (e.g. manual workflow on Lyo Sample and OSLC RefImpl) or adds unit/integration tests.
  • This PR does NOT break the API

Issues

Closes #605

See:

if (responseInfos.size() == 1) {
infoResource = responseInfos.get(0);
} else if (responseInfos.size() > 1) {
List<Resource> infos_sameURI = responseInfos.stream().filter(ri -> ri.getURI().equals(query.getQueryUrl())).toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make more sense to replace "equals" with startsWith?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, there is no strict rule on the ordering of query params, so the substring check does not have a strong meaning. I was thinking to just cut off all the query params and compare the URLs with all params stripped but I wanted to hear from Ana how her testing goes before altering the URIs.

Copy link
Contributor

Choose a reason for hiding this comment

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

True.

Copy link

sonarcloud bot commented Sep 19, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 30%)

See analysis details on SonarCloud

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.

Query response may contain ResponseInfo[1..*]
2 participants