Support tag_ids on JSON card create/update#2830
Draft
robzolkos wants to merge 11 commits intobasecamp:mainfrom
Draft
Support tag_ids on JSON card create/update#2830robzolkos wants to merge 11 commits intobasecamp:mainfrom
robzolkos wants to merge 11 commits intobasecamp:mainfrom
Conversation
|
Glad to see this coming to light! #2340 |
e33603a to
7a1bedf
Compare
flavorjones
requested changes
Apr 14, 2026
Member
flavorjones
left a comment
There was a problem hiding this comment.
This looks great, nice simplification from the earlier version. Two edge cases I'd like to see tests for — not because I think they're necessarily broken, but because the behavior should be fully specified:
- Clearing tags with
tag_ids: []— the setter handles this path explicitly, so let's cover it. - Update without
tag_idspreserves existing tags — confirms that omitting tag_ids from an update doesn't accidentally clear tags.
flavorjones
reviewed
Apr 14, 2026
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
The cards JSON API already documents support for
tag_ids, butCardsControllerwas not wrapping or permitting that parameter. As a result, API clients could create or update cards successfully while tags were silently dropped from the request and the response came back with an emptytagsarray.This change makes
tag_idswork for JSON card create/update requests so the API behavior matches the docs and client expectations. It also validates that assigned tags belong to the card's account and returns standard unprocessable-entity responses for invalid tag assignments.Ref: #2819
Changes
tag_ids: []inCardsController#card_paramstag_idsinwrap_parameters :cardso flat JSON payloads work too422 Unprocessable Entityfor invalid JSON card create/update requests422 Unprocessable Entityfor invalid HTML card updatescard: { tag_ids: [...] }tag_ids: [...]card: { tag_ids: [...] }tag_ids: [...]tag_ids: []tag_idsis omitted from an updateNotes
tag_idsfor card create/update404 Not Found422 Unprocessable Entity