Skip to content

Conversation

yaswanthrajeev
Copy link

Add Search Functionality to Items API

Summary

  • Introduced a search query parameter to the /api/v1/items/ endpoint.
  • Enables searching items by title or description (case-insensitive, partial match).

How to Test

curl -X GET "http://localhost:8000/api/v1/items/?search=example" \
  -H "Authorization: Bearer <your_access_token>"

It will render with headings, lists, and code blocks.

---

**You’re good to go—just copy and paste!**

@YuriiMotov
Copy link
Contributor

YuriiMotov commented Sep 3, 2025

@yaswanthrajeev, thank you for the interest in project!

Do you have plans to continue working on this?
For now it looks incomplete. I'll convert it to draft. Press "Ready for review" when it's ready

@YuriiMotov YuriiMotov marked this pull request as draft September 3, 2025 10:21
assert response.status_code == 200
content = response.json()
assert content["count"] == 1
assert content["data"][0]["title"] == "Alpha Item"

Choose a reason for hiding this comment

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

Maybe also assert that item2 is NOT returned, just to be explicit about the filtering.

assert response.status_code == 200
content = response.json()
assert content["count"] == 2
assert len(content["data"]) == 2

Choose a reason for hiding this comment

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

Maybe also assert the titles of the returned items (e.g., "Test Item 1" and "Test Item 2") so the test is stronger and doesn’t rely on implicit ordering.

@github-actions github-actions bot removed the waiting label Sep 14, 2025
Copy link
Contributor

This pull request has a merge conflict that needs to be resolved.

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically generated when a PR has a merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants