-
Notifications
You must be signed in to change notification settings - Fork 0
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: Enable paging for search endpoints #30
Conversation
Just moving things into separate files for better discoverability/readability
|
||
lazy val router: HttpApp[F] = | ||
Router[F]( | ||
s"/$businessRoot" -> businessRoutes, | ||
"/" -> operationsRoutes | ||
"/search" -> (OpenApiRoute(businessEndpoints) <+> search.routes), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if it wouldn't be good to keep the /search
segment somewhere so it can be shared between this class and the SearchRoutes
(the definition of server for the OpenAPI spec).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I removed it because it wasn't used anywhere else - but I now saw the other occurrence in OpenApiRoute
. Thanks, will bring it back!
val perPage = | ||
queryParam[Int]("per_page") | ||
.description("How many items to return for one page") | ||
.validate(Validator.min(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so we won't forget, maybe we could add max validator as we are working on this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Accepts optional request parameters
per_page
andpage
and return paging information with response headers.