adobe / adobe/spacecat-api-service

Validate Entities and Return 400

Open
#114 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
10
Forks
15
Avg merge
1d 9h
Merged PRs (30d)
150

Description

Currently when creating entities such as a Site or Organization a validation layer by the data layer (e.g. due to a missing required property) will cause a HTTP Status of 500 instead of 400.

- [ ] Update API spec to feature relevant 400 reponses
- [ ] Update API controllers to validate an entity (e.g. by using `createSite` et al directly) and returning `badRequest`

Contributor guide

Open the contributing guide

Research direction

Start with the API specification and API controllers, then trace entity creation through methods such as `createSite` to identify where data-layer validation becomes HTTP 500. Update the documented 400 responses and verify controllers return `badRequest` for missing required properties across entities such as Site and Organization.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.