Skip to content

Commit 0663b8a

Browse files
authored
Add missing file type enum values to openapi spec (#4936)
1 parent 1f48f5b commit 0663b8a

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

apps/docs/public/openapi.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,26 @@ components:
394394
description: The hash of the file you're editing
395395
example: aaaabbbbccccddddeeeeffffgggghhhhiiiijjjj
396396
file_type:
397-
type: string
398-
enum: [required-resource-pack, optional-resource-pack]
399-
description: The hash algorithm of the file you're editing
400-
example: required-resource-pack
401-
nullable: true
397+
allOf:
398+
- $ref: '#/components/schemas/FileTypeEnum'
399+
- nullable: true
400+
description: The hash algorithm of the file you're editing
402401
required:
403402
- algorithm
404403
- hash
405404
- file_type
405+
# https://github.com/modrinth/code/blob/main/apps/labrinth/src/models/v3/projects.rs#L981-990
406+
FileTypeEnum:
407+
type: string
408+
enum:
409+
- required-resource-pack
410+
- optional-resource-pack
411+
- sources-jar
412+
- dev-jar
413+
- javadoc-jar
414+
- unknown
415+
- signature
416+
example: required-resource-pack
406417
# https://github.com/modrinth/labrinth/blob/master/src/routes/version_creation.rs#L27-L57
407418
CreatableVersion:
408419
allOf:
@@ -506,11 +517,10 @@ components:
506517
example: 1097270
507518
description: The size of the file in bytes
508519
file_type:
509-
type: string
510-
enum: [required-resource-pack, optional-resource-pack]
511-
description: The type of the additional file, used mainly for adding resource packs to datapacks
512-
example: required-resource-pack
513-
nullable: true
520+
allOf:
521+
- $ref: '#/components/schemas/FileTypeEnum'
522+
- nullable: true
523+
description: The type of the additional file, used mainly for adding resource packs to datapacks
514524
required:
515525
- hashes
516526
- url

0 commit comments

Comments
 (0)