core icon indicating copy to clipboard operation
core copied to clipboard

Implement/Enhance POST /api/v2/tags and GET /api/v2/tags/{idOrName} endpoints (Core Tag Operations)

Open hassandotcms opened this issue 1 year ago • 1 comments

Task

Context: Part of Feature #32941 (Single Tag Operations) in Tags Portlet Modernization Epic. This story implements/enhances both create and retrieve endpoints together to ensure testability - we can create a tag and immediately verify it via GET.

Definition of Done:

  • POST /api/v2/tags implementation:
    • Tag name validation: required, non-blank, max 255 chars, no commas
    • Site ID validation with fallback
    • Returns 201 for create tag (create tag is idempotent)
  • GET /api/v2/tags/{idOrName} implementation:
    • Supports both UUID and tag name
    • Query parameter siteId for name-based retrieval
    • Returns 200 with tag object
  • Shared response entity (ResponseEntityTagView)
  • Error responses for both endpoints (400, 401, 403, 404, 500)
  • Postman test suite for create→get flow

Proposed Objective

Same as Parent Issue

Proposed Priority

Same as Parent Issue

Acceptance Criteria

  1. Can create a tag and retrieve it by ID
  2. Can create a tag and retrieve it by name+siteId
  3. Create validation errors return proper 400 responses
  4. Get returns 404 for non-existent tags

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

hassandotcms avatar Aug 11 '25 15:08 hassandotcms

PRs linked to this issue

github-actions[bot] avatar Aug 18 '25 14:08 github-actions[bot]