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

Specify document search parameter as HTTP params #722

Merged
merged 24 commits into from
Oct 19, 2023

Conversation

archiloque
Copy link
Contributor

@archiloque archiloque commented Sep 25, 2023

An implementation for #720 , feedbacks are welcome.

I'm still doing some tests.

Notes so far:

  • I tried to share the code between the two ways of passing parameters, I moved the related code to docs-web/src/main/java/com/sismics/docs/rest/util/DocumentSearchCriteriaUtil.java to avoid making a mess of docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java, at the end it's not too much new code.
  • Moved docs-web/src/main/java/com/sismics/docs/rest/util/TagUtil.java from docs-core because it was not used outside of docs-web.
  • I've renamed the simple search as simple search, so it's easier to distinguish between simple and full.
  • Specified some parameters as optionals, even with other end points.
  • Cleaning some code duplication between get and list for documents when generating the responses, as a consequence I added the file_id field to the get response because it was missing there but was in the list one, which did not make sense.

I wonder if all the cases exposed through the "textual API" make sense for a programmatic one, for example:

  • at can be replaced by before and an after, should it be available?
  • exposing several date formats, maybe the yyyy-MM-dd one should be enough?

What's your opinion ?

@jendib
Copy link
Member

jendib commented Oct 8, 2023

Looks good.

I agree that "at" and date formats other than "yyyy-MM-dd" could be removed to simplifiy. It should be the role of the caller to do those things with "before" and "after".

@archiloque
Copy link
Contributor Author

@jendib thanks, I've updated the code accordingly

@jendib
Copy link
Member

jendib commented Oct 17, 2023

@archiloque Is this ready to merge?

@archiloque
Copy link
Contributor Author

@jendib yes, I've done some integration tests and it seems to work

@jendib jendib merged commit 04c43eb into sismics:master Oct 19, 2023
@jendib jendib added this to the v1.12 milestone Nov 6, 2023
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