Page 1 of 1

Proposal: Publish JSON schema for mod's info.json on API Docs portal

Posted: Sun Dec 15, 2024 4:36 pm
by Hares
TL;DR
API Docs should provide JSON schema for `info.json` file.
Why?
JSON schema is popular and well-supported format for validating JSONs before submission.
It is also integrated to most of the IDEs.
I've seen JSON shemas for 1.1, but for 2.0 there're none.

Why not?
I can hear you suggesting me to use modding development toolkit, but it's supported only for VSCode IDE, and thus its usage is rather limited.
Disclaimer: Biased opinion.
VSCode has horrible UI clearance, terrible performance, and has many other problems. Not all mods require extended Lua checkers, and for file-tree management I would 100% prefer JetBrains' IDEs.

Re: Proposal: Publish JSON schema for mod's info.json on API Docs portal

Posted: Thu Mar 27, 2025 9:28 pm
by BraveCaperCat
Screenshot 2025-03-27 212528-modified.png
Screenshot 2025-03-27 212528-modified.png (46.66 KiB) Viewed 301 times
As seen in the provided image, the FMTK is compatible with NPM-supporting editors. I'm sorry if your editor of choice doesn't support NPM packages.
Disclaimer: Biased opinion. Copied and Modified from your post.
VSCode has great UI clearance, performant performance, and has very little problems. Not all mods require extended Lua checkers, but it is sometimes helpful. And for file-tree management I 100% prefer VSCode. Don't get me started on how plain VS is bad, though.

Re: Proposal: Publish JSON schema for mod's info.json on API Docs portal

Posted: Sun May 11, 2025 2:04 pm
by Sharparam
JSON schemas are useful for more than just editors, so suggesting an NPM package doesn't really do anything.

Thankfully, the repo for FMTK makes the actual schema files available: https://github.com/justarandomgeek/vsco ... ent/schema

So you should be able to use them like this:

Code: Select all

{
  "$schema": "https://github.com/justarandomgeek/vscode-factoriomod-debug/raw/refs/heads/current/schema/datainfo.json"
}
It's not perfect though, since these schema files don't seem to be intended to be used directly like this, any that use a "$ref" field to refer to other schema files (like modinfo.json) won't work since they don't use the fully qualified URL for the files.