mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
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:
1 parent
7c2793752d
commit
5b1f7d796d
1 file changed
+4
-1
@@ -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()),
|
||||
|
||||
Reference in new issue
Block a user