Add missing file type enum values to openapi spec (#4936)

This commit is contained in:
Julian Vennen
2025-12-19 22:11:47 +01:00
committed by GitHub
parent 1f48f5b5af
commit 0663b8adb0

View File

@@ -394,15 +394,26 @@ components:
description: The hash of the file you're editing description: The hash of the file you're editing
example: aaaabbbbccccddddeeeeffffgggghhhhiiiijjjj example: aaaabbbbccccddddeeeeffffgggghhhhiiiijjjj
file_type: file_type:
type: string allOf:
enum: [required-resource-pack, optional-resource-pack] - $ref: '#/components/schemas/FileTypeEnum'
description: The hash algorithm of the file you're editing - nullable: true
example: required-resource-pack description: The hash algorithm of the file you're editing
nullable: true
required: required:
- algorithm - algorithm
- hash - hash
- file_type - file_type
# https://github.com/modrinth/code/blob/main/apps/labrinth/src/models/v3/projects.rs#L981-990
FileTypeEnum:
type: string
enum:
- required-resource-pack
- optional-resource-pack
- sources-jar
- dev-jar
- javadoc-jar
- unknown
- signature
example: required-resource-pack
# https://github.com/modrinth/labrinth/blob/master/src/routes/version_creation.rs#L27-L57 # https://github.com/modrinth/labrinth/blob/master/src/routes/version_creation.rs#L27-L57
CreatableVersion: CreatableVersion:
allOf: allOf:
@@ -506,11 +517,10 @@ components:
example: 1097270 example: 1097270
description: The size of the file in bytes description: The size of the file in bytes
file_type: file_type:
type: string allOf:
enum: [required-resource-pack, optional-resource-pack] - $ref: '#/components/schemas/FileTypeEnum'
description: The type of the additional file, used mainly for adding resource packs to datapacks - nullable: true
example: required-resource-pack description: The type of the additional file, used mainly for adding resource packs to datapacks
nullable: true
required: required:
- hashes - hashes
- url - url