Skip to content

Conversation

devin-ai-integration[bot]
Copy link

Enhance JSON Field to Support YAML and JSON5 Formats

This PR enhances the JSON field in PayloadCMS to support both YAML and JSON5 formats for better human readability and editing.

Changes

  1. Added a format option to the JSONField type that supports three formats:

    • json (default)
    • yaml
    • json5
  2. Updated the JSON field component to handle all three formats:

    • Added imports for yaml and JSON5 libraries
    • Modified the component to parse and stringify based on the selected format
    • Updated the editor language mode based on the format

Benefits

  • Improved human readability for configuration files
  • Better editing experience with YAML's more forgiving syntax
  • Support for comments and trailing commas with JSON5

Testing

The changes have been tested with the linter to ensure code quality and consistency.

Link to Devin run: https://app.devin.ai/sessions/fd713ee25e83445eb107fafcbaf7e956

Requested by: Nathan Clevenger ([email protected])

Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants