Skip to content

Add API to filter pets by type and name with lightweight response end…#2318

Open
shrutisharma-sh wants to merge 1 commit intospring-projects:mainfrom
shrutisharma-sh:feature/petfilter-api
Open

Add API to filter pets by type and name with lightweight response end…#2318
shrutisharma-sh wants to merge 1 commit intospring-projects:mainfrom
shrutisharma-sh:feature/petfilter-api

Conversation

@shrutisharma-sh
Copy link
Copy Markdown

Added Pet Filter API

  • Added GET /api/pets to filter pets by type and name
  • Added GET /api/pets/names for lightweight response (name + type only)
  • Supports optional query parameters: type, name

This improves API usability for frontend and integrations.

…point

Signed-off-by: shrutisharma-sh <shrutish8439@gmail.com>

public class PetRestController {

private final OwnerRepository ownerRepository;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use a service layer so that logic will be in the service layer rather than in the controller itself.

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