dotCMS / dotCMS/core

[FEATURE] A "Pretty Print" check box for JSON Field.

Open
#34,341 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support stale
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem

Currently, when publishing a contentlet that contains JSON within a JSON Field, it removes all return characters and tab characters, bringing it to a single raw line making it difficult to edit or read the JSON.

https://github.com/user-attachments/assets/42ad63ba-797d-408c-a193-42875adeda5c

Goal

Having an option to enable pretty print would make these JSON Fields a lot easier to edit when going back into a contentlet, as well as easier to read.

Target Personas
  • Developer teams
  • Content teams
  • DevOps teams
  • System administrators (dotCMS)
Demo Expectations

In the demo, we will show the Pretty Print check box for the JSON Field type and how it re-organizes the text.

Acceptance Criteria

When the “Pretty Print” checkbox is enabled, valid JSON entered into the field is automatically formatted with line breaks and indentation.

User Stories

No response

Links

https://helpdesk.dotcms.com/a/tickets/35088

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

No files or tests are named. Start by locating the JSON Field editor and its existing publish or formatting behavior, then trace how field options are stored. Done means the editor exposes a Pretty Print checkbox and valid JSON is shown with line breaks and indentation when it is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
content
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.