decaporg / decaporg/decap-cms

The keys in the generated JSON content are unordered

Open
#6,901 1 comment 1 reaction 0 assignees View on GitHub
pinned type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**

The keys in the generated JSON content are unordered.

**To Reproduce**

https://github.com/liby/decap-cms-field-sort-issue#reproduction-steps

**Expected behavior**

The keys are sorted in alphabetical order from A-Z or as described [in the document](https://decapcms.org/docs/configuration-options/#fields:~:text=The%20order%20of%20the%20fields%20in%20your%20Decap%20CMS%20config.yml%20file%20determines%20their%20order%20in%20the%20editor%20UI%20and%20in%20the%20saved%20file):
> The fields option maps editor UI widgets to field-value pairs in the saved file. The order of the fields in your Decap CMS config.yml file determines their order in the editor UI and in the saved file.

**Screenshots**

![image](https://github.com/decaporg/decap-cms/assets/38807139/2ead7135-e4eb-4746-ab32-33c7892ff4ff)

**Applicable Versions:**

- Decap CMS version: 3.0.0
- Git provider: GitHub
- OS: macOS 13.5.1 (22G90)
- Browser version: Chrome 116.0.5845.140

- Node.JS version: 18.17.0

**CMS configuration**

https://github.com/liby/decap-cms-field-sort-issue/blob/main/admin/config.yml

**Additional context**

[Possible relevant discussions](https://github.com/decaporg/decap-cms/discussions/6760).

Contributor guide

Open the contributing guide

Research direction

Start with the linked reproduction repository and its admin/config.yml, then compare the declared field order with the generated JSON content. Check the linked discussion for context about ordering behavior. Done means generated keys follow the configured field order in the saved file.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.