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

/api/v1/widget/shared/search?term returns the first result which contains the term instead of matching it exactly #1608

Open
rujutashinde opened this issue Aug 1, 2022 · 0 comments

Comments

@rujutashinde
Copy link

rujutashinde commented Aug 1, 2022

If we use the api /api/v1/widget/shared/search?term= to search for a widget with name "launch1 Launches Table"
it returns results which contain the word launch1 Launches Table instead of matching the exact string

This way if there is launch1 Launches Table and hello_launch1 Launches table, it returns the entry which was created first, so hello_lauch1 Launches Table is returned

e.g

url: https://<RP INSTANCE URL>/api/v1/<project_name>/widget/shared/search?term=launch1 Launches Table
 r.status_code: 200
 r.text: {"content":[{"description":"RP PreProc Auto widget","owner":"teflo_user","share":true,"id":360,"name":"teflo_launch1 Launches Table","widgetType":"launchesTable","contentParameters":{"contentFields":[],"itemsCount":10}}],"page":{"number":1,"size":20,"totalElements":1,"totalPages":1}}

Current version:API Service: 5.6.3
Authorization Service: 5.6.3
Service UI: 5.6.0

Could it be because it is looking for find any instead of exact string?

return Arrays.stream(DataProviderType.values()).filter(type -> type.getType().equalsIgnoreCase(name)).findAny();

@rujutashinde rujutashinde changed the title /api/v1/widget/shared/search?term returns the first result which contains the term instead of matching it exacty /api/v1/widget/shared/search?term returns the first result which contains the term instead of matching it exactly Aug 1, 2022
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

No branches or pull requests

1 participant