Last modified: 2014-02-26 12:53:17 UTC
When you try to save invalid JSON into a page in the Schema namespace on Meta-Wiki (e.g., <https://meta.wikimedia.org/wiki/Schema:Sandbox>), an error message appears: --- Invalid JSON. The content of this page must be valid JSON. Please check your syntax. --- This error message does not currently include on which line(s) there's an alleged error, though. It'd be nice if it listed the lines containing errors or highlighted the offending lines in red or both or something. Maybe activating the CodeEditor extension on this namespace (bug 42561) would help mitigate the issue of invalid JSON being submitted, but a more direct error message from this extension would be nice.
I'm gonna go ahead and mark this bug as easy. If that's inaccurate, feel free to remove the keyword.
Linebreaks in JSON aren't significant, and the content model treats them as presentational artifacts (for example, by coercing all edits into a consistent format). So associating an error with a particular line isn't quite right. It might be easiest to simply indicate the specific character on which parsing finally choked, including the line it appeared on. This probably involves modifying the FormatJson class in core, but you're right -- I don't think it'll be a difficult change to make.
[moving from MediaWiki extensions to Analytics product - see bug 61946]