Make ModInfo.jsonSchema strict about the major.minor factorio_version

The stored ModInfo always normalises factorio_version to a major.minor (see
fromJSON), so the serialised schema can use the strict MajorMinorVersionSchema
while infoJsonSchema keeps the lenient GameVersionSchema for raw info.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 4.8 committed 2026-06-29 22:49:59 +00:00
1 parent 7c2793752d
commit 5b1f7d796d
1 file changed
+4 -1
+4 -1
View File
@@ -11,7 +11,7 @@ import {
FullVersion, integerFullVersion,
integerPartialVersion,
GameVersionSchema, normaliseGameVersion, normaliseMajorMinorVersion,
MajorMinorVersion,
MajorMinorVersion, MajorMinorVersionSchema,
ModVersionEquality,
} from "./version";
@@ -266,6 +266,9 @@ export default class ModInfo {
static jsonSchema = Type.Object({
...this.infoJsonSchema.properties,
// The stored value is always normalised to a strict major.minor (see fromJSON),
// unlike the lenient info.json schema above.
"factorio_version": Type.Optional(MajorMinorVersionSchema),
"size": Type.Optional(Type.Integer()),
"mtime_ms": Type.Optional(Type.Number()),
"sha1": Type.Optional(Type.String()),