dotCMS / dotCMS/core

[Import Content]: Improve `context` Object Structure in Error Responses

Open
#32,826 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale Team : Scout Type : Task
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Taks

This spike explores whether we can improve the readability and clarity of the context object in error responses returned by the Content Import API. The goal is to make the structure more intuitive and user-friendly—especially for non-technical users or developers unfamiliar with error formats.

Current Behavior

Example error response from the import endpoint:

{
  "error": [
    {
      "code": "INVALID_JSON",
      "context": {
        "column": 2,
        "line": 1,
        "parseError": "Unexpected end-of-input: expected close marker for Object"
      },
      "field": "keyvalue"
    }
  ]
}
Proposed Improvement

Consider renaming the context object to details and making the parseError field more user-friendly, like errorHint:

{
  "error": [
    {
      "code": "INVALID_JSON",
      "details": {
        "column": 2,
        "line": 1,
        "errorHint": "Unexpected end-of-input: expected close marker for Object"
      },
      "field": "keyvalue"
    }
  ]
}

This naming is more approachable and communicates intent better to end users and front-end consumers of the API.

Proposed Objective

User Experience

Proposed Priority

Priority 4 – Trivial

Acceptance Criteria
  • [ ] Investigate whether renaming context to details is technically feasible across all relevant Import Content API responses.
  • [ ] Assess the impact of renaming parseError to a friendlier key like errorHint.
  • [ ] Open a discussion with the team (or product) to decide:
  • Is this change valuable enough to justify?
  • Is it backwards-compatible or does it require versioning?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Content Import API error response contract and every response that uses the context and parseError fields. Assess whether details and errorHint are feasible and backward-compatible, then document the team or product decision and any versioning requirement as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.