-
Notifications
You must be signed in to change notification settings - Fork 0
Form validation #15
Copy link
Copy link
Open
Labels
area:apiHTTP API endpoints, contracts, routing, and responsesHTTP API endpoints, contracts, routing, and responsesarea:backendBackend application, domain, infrastructure, or server codeBackend application, domain, infrastructure, or server codearea:catalogMovie catalog domain and catalog-related featuresMovie catalog domain and catalog-related featuresarea:frontendAngular frontend application codeAngular frontend application codepriority:highHigh-priority work for the current milestoneHigh-priority work for the current milestonetype:featureNew user-facing or product capabilityNew user-facing or product capabilityv1Included in the Version 1 product scopeIncluded in the Version 1 product scope
Milestone
Description
Metadata
Metadata
Assignees
Labels
area:apiHTTP API endpoints, contracts, routing, and responsesHTTP API endpoints, contracts, routing, and responsesarea:backendBackend application, domain, infrastructure, or server codeBackend application, domain, infrastructure, or server codearea:catalogMovie catalog domain and catalog-related featuresMovie catalog domain and catalog-related featuresarea:frontendAngular frontend application codeAngular frontend application codepriority:highHigh-priority work for the current milestoneHigh-priority work for the current milestonetype:featureNew user-facing or product capabilityNew user-facing or product capabilityv1Included in the Version 1 product scopeIncluded in the Version 1 product scope
Projects
StatusShow more project fields
Backlog
Summary
Implement consistent validation for movie create and edit forms.
This issue improves reliability and user experience by validating movie data both on the frontend and at the API boundary.
Goal
Prevent invalid movie data from being submitted or accepted.
Scope
application/problem+json.Suggested Validation Rules
Required fields:
titlereleaseYearRecommended constraints:
title: required, max lengthoriginalTitle: optional, max lengthreleaseYear: valid year rangecountryCode: optional ISO-like codeoriginalLanguage: optional language codegenres: optional list, max item lengthdirector: optional, max lengthsynopsis: optional, max lengthdurationMinutes: optional positive numberageRating: optional, max lengthExample semantic validation error response:
{ "type": "https://smartmoviecatalog.dev/problems/validation-error", "title": "Validation failed.", "status": 422, "detail": "One or more validation errors occurred.", "instance": "/api/movies", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00", "errors": { "title": [ "Title is required." ], "releaseYear": [ "Release year must be greater than or equal to 1888." ], "durationMinutes": [ "Duration must be greater than zero." ] } }Acceptance Criteria
400 Bad Requestwithapplication/problem+json.422 Unprocessable Contentwithapplication/problem+json.Technical Notes
type,title,status,detail,instance, optionaltraceId, and optional field-levelerrors.Out of Scope