-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate config.schema.json
file for validation inside mod managers
#928
Comments
Hi! SMAPI could generate a schema, but:
That said, my concern is that it'd cause confusion for the majority of players who edit it directly. We'd probably have players trying to edit |
Right, any validation done in C# that can't be inferred from the type alone wouldn't appear in the schema. I can imagine that some mods might have range requirements on integer values. However, the user wouldn't know about these requirements from looking at the
Do you know of any mods that do this? I'm curious how they handle config versioning. My idea was generating a schema when calling
Would it be enough to put this feature behind a config value in SMAPI itself that's disabled by default? Something inside |
SMAPI still uses |
SMAPI mods write
config.json
files into the mod folder. This is the usual modding process:To make modding easier and less error-prone, mod managers should be able to validate the
config.json
file without requiring the user to run the game and check the SMAPI logs:Currently, mod managers are only able to validate if the
config.json
file is valid JSON. For validation of properties, mod managers would need a JSON schema fileconfig.schema.json
. Such a file could be generated by SMAPI on startup.Besides validation, a schema file would also allow mod managers to provide rich config editors without requiring users to open external tools like Notepad++ or VS Code. This makes modding even easier and will massively reduce support questions for broken config files.
The text was updated successfully, but these errors were encountered: