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/add basic search for org persion place and tag #26

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

YukinaMochizuki
Copy link
Contributor

Feature

Add four endpoints:

  • /api/search/basic/tag/{name}
  • /api/search/basic/organization/{name}
  • /api/search/basic/person/{name}
  • /api/search/basic/place/{name}

Multiple search keywords can be given at once separated by spaces

@YukinaMochizuki YukinaMochizuki self-assigned this Apr 6, 2023
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 4 0 0.04s
✅ DOCKERFILE hadolint 1 0 0.06s
✅ JAVA checkstyle 67 0 3.56s
✅ JSON eslint-plugin-jsonc 2 0 0 0.74s
✅ JSON jsonlint 2 0 0.14s
✅ JSON prettier 2 0 0 0.41s
✅ JSON v8r 2 0 2.08s
✅ MAKEFILE checkmake 1 0 0.01s
✅ MARKDOWN markdownlint 1 0 0 0.25s
✅ MARKDOWN markdown-link-check 1 0 0.8s
✅ MARKDOWN markdown-table-formatter 1 0 0 0.23s
✅ REPOSITORY gitleaks yes no 0.2s
✅ REPOSITORY git_diff yes no 0.0s
✅ REPOSITORY secretlint yes no 1.2s
✅ REPOSITORY trivy yes no 5.32s
✅ XML xmllint 1 0 0 0.01s
✅ YAML prettier 5 0 0 0.54s
✅ YAML v8r 5 0 4.34s
✅ YAML yamllint 5 0 0.21s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@moontai0724
Copy link
Member

Instead of using the URI, I would recommend using query parameters in the following format:

/api/search/basic/tag?keyword={name1}&keyword={name2}

There are several benefits to using this approach:

  1. The list route (e.g. /tag) can be used to list tags that match the given conditions, making it more meaningful.
  2. The query parameters can be sent as an array, such as the keyword array in the example. This eliminates the need for additional string split processes.
  3. This approach will not impact other routes like /tag/{UUID}, and there will be no possible rules that would need to apply to it, such as limiting the tag to a non-UUID format, even if it doesn't make logical sense.
  4. Adding additional conditions would be easier with this approach, making it more extendable.

@YukinaMochizuki
Copy link
Contributor Author

Do you mean that the front end will assist in splitting the user's input by whitespace?

@moontai0724
Copy link
Member

moontai0724 commented Apr 6, 2023

Do you mean that the front end will assist in splitting the user's input by whitespace?

Yes, and it could be a rule that the query params should not include spaces.
or it could be a single param that can include spaces.

Copy link
Member

@moontai0724 moontai0724 left a comment

Choose a reason for hiding this comment

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

Comments above.

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.

2 participants