ScoutingPASS icon indicating copy to clipboard operation
ScoutingPASS copied to clipboard

Pre-parse JSON for proper format and all required elements

Open fuddster opened this issue 3 years ago • 1 comments

fuddster avatar Feb 12 '22 19:02 fuddster

No description, so not sure exactly what you have in mind for this issue. I have noticed that the form definition JSON data is in a string, and is parsed by JavaScript in the web page, showing any parse errors on the web page. I was thinking of removing the quotes around the JSON data, and just defining a variable to the bare JSON, changing the extension to .js and including it with a script src= tag.

This means no more friendly error messages on the web page, but buys you syntax highlighting and other editor aids VS Code can offer for JavaScript coders when editing the config data.

I might consider that pre-parsing JSON, by the editor at least. Not sure about checking for required elements though. Probably need a separate script for that.

zaaj avatar Oct 27 '23 03:10 zaaj