Fix CurseForge apiVersion type from number to string

This commit is contained in:
CPTProgrammer 2026-07-10 13:04:20 +08:00
parent 58d72d06fe
commit 9bc693e3a1
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ GET https://minecraft.curseforge.com/api/game/versions
| `gameVersionTypeID` | int | 版本类型 ID |
| `name` | string | 版本名称(如 `1.21.5` |
| `slug` | string | 版本标识(如 `1-21-5` |
| `apiVersion` | int \| null | API 版本号 |
| `apiVersion` | string \| null | API 版本号 |
> **注意:** Game Versions 列表并非仅包含游戏版本号,而是将 Mod LoaderForge、Fabric 等、EnvironmentClient、Server甚至 Java 版本都混在一起。具体某个版本属于哪个类型,看它的 `gameVersionTypeID`,对应 [Game Version Types API](#game-version-types-api) 中的 `id`

View File

@ -22,8 +22,8 @@ export const GameVersionSchema = z.object({
name: z.string(),
/** 版本标识,如 "1-21-5" */
slug: z.string(),
/** API 版本号,无则为 null */
apiVersion: z.number().int().nullable(),
/** API 版本号,无则为 null 或空字符串 */
apiVersion: z.string().nullable(),
});
export type GameVersion = z.infer<typeof GameVersionSchema>;
// endregion