Validate JSON feed and don't fail silently

Created on 21 June 2025, 4 months ago

Problem/Motivation

It would be great if the JSON importer gave just a little feedback about the problem, if a wrongly formatted JSON file is the reason. A simple comma in the wrong place, and nothing happens :)

Steps to reproduce

Try to import with JSON, and drush migrate:status reporting back there are "0" Unprocessed items, and having a hard time to understand what the problem is.

Trying many different things, and finally finding the problem was a comma in the wrong place.

Proposed resolution

Maybe do some simple validation, and offer feedback like "The JSON feed doesn't validate". It would be even better if the feedback could be specific, like if you enter this:

{
  "a": "b",
}

It could say

Invalid JSON. Error: Parse error on line 2:
{    "a": "b",}
--------------^
Expecting 'STRING', got '}'

But even just getting "Invalid JSON" feedback without details, would in itself be a great improvement.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

6.0

Component

API

Created by

🇩🇰Denmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024