Skip to content

Enhance EmployeeController: Validation, Consistent Paths, and REST Best Practices #97

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

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

Conversation

ritesh5604
Copy link

This PR improves the EmployeeController in the following ways:

  • Added @Valid annotation to createEmployee method for input validation.
  • Standardized endpoint paths with leading slashes.
  • Modified createEmployee to return HTTP 201 Created with Location header.
  • Updated deleteEmployee to return HTTP 204 No Content.
  • Renamed method getAllEmployee to getAllEmployees for better naming consistency.
  • Added produces/consumes headers to clearly define JSON content type.

These changes improve REST compliance, input validation, consistency, and make the API more production-ready.

Looking forward to feedback and suggestions! 🚀

Copy link

@pratik-mahalle pratik-mahalle left a comment

Choose a reason for hiding this comment

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

Hey @ritesh5604, Thank you for raising the pr. Our team will review the changes soon.

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