fix: improve recommendation input validation for unsupported values (#676)#677
Conversation
|
@mishtiagrawal02-cloud is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for the contribution. I reviewed the changes and appreciate the additional test coverage and effort to improve validation. However, this implementation introduces hardcoded lists of supported interests, levels, and time values directly in the backend. This creates a maintenance burden and can easily become inconsistent with the actual options available in the application as new categories are added or existing ones change. Because the validation logic relies on duplicated hardcoded values rather than a centralized source of truth, it may reject valid future inputs and make the system harder to maintain. For these reasons, I’m closing this pull request. A future validation improvement should derive allowed values from a shared configuration rather than duplicating them in multiple places. Thank you for contributing to DevPath. |
Summary
This PR improves recommendation input validation by adding stricter checks for unsupported values in recommendation inputs.
Previously, validation only checked for missing fields, which allowed unsupported values (such as invalid time availability, unsupported experience levels, or unsupported interests) to reach recommendation logic and potentially cause inconsistent behavior. This update validates allowed values and returns meaningful validation errors. Additional tests were added to cover invalid input cases.
Related Issue
Closes #676
Type of Change
data/projects.jsonWhat Was Changed
utils/recommender.pytests/test_basic.pyHow to Test This PR
Expected result:
Test Results
Self-Review Checklist
Notes for Reviewer
This PR improves recommendation input validation by rejecting unsupported values and adds test coverage for invalid input cases.