Shopify / Shopify/liquid

Shopify Code Editor (feature suggestion): Instead of "Invalid JSON", point out the first validation error.

Open
#1,437 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

If I use a JSON with a mistake like this example:

  {
    "name": "Logo Carousel",
    "blocks": [
      {
        "type": "logo",
        "name": "Logo"
        "settings": [
...

The Shopify Theme Code Editor will only give a generic error message:

Error: Invalid JSON in tag 'schema'

If I run the JSON through a tool like JSONLint, a more specific error message is shown:

Error: Parse error on line 5:
...	"name": "Logo"  		"settings": [{  			
----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'STRING'

I think the ability to validate the JSON and give the specific error pointing out where the validation fails would be immensely useful, and would avoid me having to copy the JSON into a lint tool.

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

Begin by locating the code path that reports "Invalid JSON in tag 'schema'" and identify how JSON validation errors are currently surfaced. Done means malformed schema JSON reports the first validation error with a useful location or message instead of only the generic error; no repository file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.