fix: return 400 when label is missing in POST /versionsource - #273
Merged
Merged
Conversation
Return a 400 'label is required' early in postObjectVersion when no body is sent or the label field is absent, preventing a misleading 500 error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
bosschaert
approved these changes
May 5, 2026
adobe-bot
pushed a commit
that referenced
this pull request
May 5, 2026
## [1.7.2](v1.7.1...v1.7.2) (2026-05-05) ### Bug Fixes * handle NoSuchKey error name in copyFile catch block ([#272](#272)) ([939b491](939b491)) * increase writeAuditEntry 412 retries to 5 and remove dead retry loop in put.js ([#274](#274)) ([2aca684](2aca684)) * return 400 when label is missing in POST /versionsource ([#273](#273)) ([36acb2b](36acb2b))
Collaborator
|
🎉 This PR is included in version 1.7.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /versionsourcewas returning 500 "Version was not created" when the request body was missing or had nolabelfield, becauselabel = undefinedcausedshouldCreateVersionObjectto befalse{ status: 400, error: 'label is required' }inpostObjectVersionwhenlabelis falsyTest plan
'label is required'label: nullin the request body also returning 400🤖 Generated with Claude Code