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

add filter for getting first result #1386

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bkulyk
Copy link

@bkulyk bkulyk commented Dec 19, 2022

Add ability to get the first resource from the index

For my use cases it's often important to be able to get the first matching value from the list endpoints.

  • Useful when id fields are different for each resources. ie: BookId, AuthorId
    GET /books?BooktId=213&_first=true
  • Useful when combined with other fields to search or sort
    GET /books?author=bkulyk&_sort=publish_date&_first=true

combined with custom routes

{
  "/api/books/id": "/books?BookId=:id&_first=true"
}

@brian-scb
Copy link

@typicode any chance you can take a look?

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.

None yet

2 participants