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

Tools which are useful for mod development.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 819
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

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

Post 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.
Fulgora is the best planet. Vulcanus needs rework. Feel free to proof me wrong.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 430
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

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

Post by BraveCaperCat »

Screenshot 2025-03-27 212528-modified.png
Screenshot 2025-03-27 212528-modified.png (46.66 KiB) Viewed 305 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.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
User avatar
Sharparam
Inserter
Inserter
Posts: 31
Joined: Sat Mar 25, 2023 11:21 pm
Contact:

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

Post 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.
Post Reply

Return to “Development tools”