-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathopenapi.yaml
More file actions
716 lines (715 loc) · 21.3 KB
/
Copy pathopenapi.yaml
File metadata and controls
716 lines (715 loc) · 21.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
openapi: 3.0.0
servers:
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/SpongePowered/Downloads/1.0.0
- description: SpongePowered Production Downloads API
url: https://dl-api.spongepowered.org/v2
info:
version: "1.0.0"
title: downloads-api
description: The API for Downloads Indexing
paths:
/groups:
get:
tags:
- Groups
description: returns all registered groups with the service
operationId: getGroups
responses:
'200':
description: All groups
content:
application/json:
schema:
$ref: '#/components/schemas/Groups'
post:
tags:
- Groups
description: registers a new group
operationId: registerGroup
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
responses:
'201':
description: Group registered
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
'/groups/{groupID}':
get:
tags:
- Groups
operationId: getGroup
parameters:
- $ref: '#/components/parameters/GroupID'
responses:
'200':
description: response
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
'404':
description: Group not found
/groups/{groupID}/artifacts:
get:
tags:
- Artifacts
operationId: getArtifacts
parameters:
- $ref: '#/components/parameters/GroupID'
responses:
'200':
description: Artifacts indexed for the group
content:
application/json:
schema:
$ref: '#/components/schemas/GroupArtifacts'
post:
tags:
- Artifacts
description: registers a new artifact under a group
operationId: registerArtifact
security:
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/GroupID'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ArtifactRegistration'
responses:
'201':
description: Artifact registered
content:
application/json:
schema:
$ref: '#/components/schemas/Artifact'
'400':
description: Bad request - invalid or missing request body
'404':
description: Group not found
'409':
description: Artifact already exists in the group
'/groups/{groupID}/artifacts/{artifactID}':
get:
tags:
- Artifacts
operationId: getArtifact
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
responses:
'200':
description: Artifact details indexed and maintained, such as repository, version tags, issues, website, etc.
content:
application/json:
schema:
$ref: '#/components/schemas/Artifact'
'404':
description: Artifact not found
patch:
tags:
- Artifacts
operationId: updateArtifact
security:
- bearerAuth: []
description: Updates mutable fields on an artifact. Only fields present in the request body are changed.
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
displayName:
type: string
description: Display name for the artifact
gitRepository:
type: array
items:
type: string
format: URL
description: Git repository URLs
website:
type: string
format: URL
issues:
type: string
format: URL
responses:
'200':
description: Artifact updated
content:
application/json:
schema:
$ref: '#/components/schemas/Artifact'
'404':
description: Artifact not found
'/groups/{groupID}/artifacts/{artifactID}/sync':
post:
tags:
- Artifacts
operationId: triggerSync
security:
- bearerAuth: []
description: |
Triggers an immediate version sync for the artifact by firing its
Temporal Schedule. Use this from CI (e.g. GitHub Actions) after
publishing a new version to Sonatype so SOAD indexes it without
waiting for the next polling interval.
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
- in: query
name: source
schema:
type: string
enum: [metadata, search]
required: false
description: |
Which version-discovery schedule to trigger. `metadata` fires the
fast 2-minute maven-metadata.xml schedule; `search` fires the
hourly REST-pagination correctness backstop schedule. Defaults
to `metadata` (the fast path) when omitted.
responses:
'200':
description: Sync triggered successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "sync triggered"
'400':
description: Invalid source value
'404':
description: No sync schedule found for this artifact (artifact may not be registered)
'500':
description: Internal error triggering sync
'/groups/{groupID}/artifacts/{artifactID}/schema':
get:
tags:
- Artifacts
operationId: getArtifactSchema
description: Returns the version schema for an artifact
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
responses:
'200':
description: The version schema
content:
application/json:
schema:
$ref: '#/components/schemas/VersionSchema'
'404':
description: Artifact not found or no schema set
put:
tags:
- Artifacts
operationId: putArtifactSchema
security:
- bearerAuth: []
description: Replaces the version schema for an artifact. Triggers recomputation of version ordering and tags.
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/VersionSchema'
responses:
'200':
description: Schema updated, ordering recomputation triggered
content:
application/json:
schema:
$ref: '#/components/schemas/VersionSchema'
'400':
description: Invalid schema (bad regex, missing segments, unknown parse_as)
'404':
description: Artifact not found
'/groups/{groupID}/artifacts/{artifactID}/latest':
get:
tags:
- Versions
operationId: getLatestVersion
description: Returns the latest version for an artifact, optionally filtered by tags.
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
- name: recommended
required: false
in: query
schema:
type: boolean
description: If true, only consider versions marked as recommended.
- name: tags
required: false
in: query
schema:
type: string
description: |
Tag filter to find the latest version matching specific tags.
Same format as getVersions: colon-separated key:value pairs,
comma-separated for multiple. Supports prefix matching.
example: "minecraft:1.21.11"
responses:
'200':
description: The latest version matching the filter
content:
application/json:
schema:
$ref: '#/components/schemas/VersionInfo'
'404':
description: Artifact not found or no versions match the filter
'/groups/{groupID}/artifacts/{artifactID}/versions':
get:
tags:
- Artifacts
- Versions
operationId: getVersions
parameters:
- $ref: '#/components/parameters/GroupID'
- $ref: '#/components/parameters/ArtifactID'
- name: recommended
required: false
in: query
schema:
type: boolean
- name: limit
required: false
in: query
schema:
type: integer
maximum: 25
minimum: 1
- name: offset
required: false
in: query
schema:
type: integer
minimum: 0
- name: tags
required: false
in: query
schema:
type: string
description: |
A colon tag value pair separated by commas to filter
versions of a desired set of tags. An example can be
'minecraft:1.12,api:7.4'
example: "minecraft:1.12.2,api:7.4"
responses:
'200':
description: The versions available
content:
application/json:
schema:
type: object
properties:
artifacts:
type: object
example:
"1.16.5-36.2.5-8.1.0-RC1331":
tagValues:
minecraft: "1.16.5"
forge: "36.2.5"
api: "8.1"
recommended: false
additionalProperties:
type: object
properties:
tagValues:
type: object
additionalProperties:
type: string
recommended:
type: boolean
offset:
type: integer
description: The offset used for this page of results
example: 0
limit:
type: integer
description: The limit used for this page of results
example: 25
size:
type: integer
description: Total number of versions matching the query (for pagination)
example: 142
'404':
description: Artifact not found
'/groups/{groupID}/artifacts/{artifactID}/versions/{versionID}':
get:
tags:
- Versions
operationId: getVersionInfo
parameters:
- name: groupID
in: path
example: org.spongepowered
schema:
type: string
description: The maven style group coordinates
required: true
- name: artifactID
in: path
schema:
type: string
example: spongeforge
description: The maven style artifact id
required: true
- name: versionID
in: path
required: true
example: "1.16.5-36.2.5-8.1.0-RC1331"
schema:
type: string
responses:
'200':
description: The version details
content:
application/json:
schema:
$ref: '#/components/schemas/VersionInfo'
'404':
description: Version not found
components:
schemas:
Group:
required:
- groupCoordinates
- name
type: object
properties:
groupCoordinates:
type: string
description: Maven style group coordinates
name:
type: string
description: The name of the group
website:
type: string
description: The website url
Groups:
type: object
required:
- groups
properties:
groups:
type: array
items:
$ref: '#/components/schemas/Group'
GroupDetails:
type: object
required:
- type
- group
properties:
type:
type: string
example: Group
group:
type: object
example:
groupCoordinates: "org.spongepowered"
name: "SpongePowered"
website: "https://spongepowered.org/"
properties:
groupCoordinates:
type: string
description: The maven style group coordinates
name:
type: string
description: The name of the group
website:
type: string
description: the website URL of the group
GroupArtifacts:
type: object
required:
- type
- artifactIds
properties:
type:
type: string
example: Artifacts
artifactIds:
type: array
items:
type: string
example:
- spongevanilla
- spongeforge
description: The artifact id's indexed for the group
Commit:
type: object
properties:
message:
type: string
example: "Add missing call to BlockEntityArchetypeVolume"
body:
type: string
example: |
Add missing call to BlockEntityArchetypeVolume
sha:
type: string
example: "10dfa6bb1248839347c845b5d7e3444885bbad49"
author:
type: object
properties:
name:
type: string
email:
type: string
link:
type: string
format: URL
example: "https://github.com/SpongePowered/Sponge/commit/10dfa6bb1248839347c845b5d7e3444885bbad49"
commitDate:
type: string
format: date
example: "2023-05-20T16:37:42Z"
Asset:
type: object
properties:
classifier:
type: string
example: ""
description: |
The classifier of the jar asset. Usually can be
understood as the "variant" of the asset. Some
variants are specific to an operating sytem, while
others are variants of the executable available. In
the case of Sponge's main assets, the empty string
classifier is the "download and run" asset desired.
downloadUrl:
type: string
format: URL
example: "https://repo.spongepowered.org/repository/maven-releases/org/spongepowered/spongeforge/1.16.5-36.2.5-8.1.0-RC1331/spongeforge-1.16.5-36.2.5-8.1.0-RC1331.jar"
description: The direct download URL
md5:
type: string
example: "74a08ef0f838bd7a4a60af59a9812cb2"
sha1:
type: string
example: "fb521aabc333533ea329ed2fd826025310766133"
extension:
type: string
example: "jar"
description: The file extension of the asset.
Artifact:
type: object
required:
- type
- coordinates
- tags
properties:
type:
type: string
example: latest
coordinates:
type: object
required:
- groupId
- artifactId
properties:
groupId:
type: string
example: org.spongepowered
artifactId:
type: string
example: spongeforge
displayName:
type: string
example: SpongeForge
description: The name of the artifact in the desired format to be displayed on the web or referenced in communication
website:
type: string
gitRepository:
type: array
items:
type: string
format: URL
issues:
type: string
format: URL
tags:
type: object
example:
api:
- "8.1"
- "8.0"
- "7.4"
- "7.3"
- "7.2"
- "7.1"
minecraft:
- "1.16.5"
- "1.12.2"
additionalProperties:
type: array
items:
type: string
ArtifactRegistration:
type: object
required:
- artifactId
- displayName
- gitRepository
properties:
artifactId:
type: string
example: spongeforge
description: The maven style artifact id
displayName:
type: string
example: SpongeForge
description: The name of the artifact in the desired format to be displayed on the web or referenced in communication
gitRepository:
type: array
items:
type: string
format: URL
example:
- "https://github.com/SpongePowered/Sponge"
description: An array of git repository URLs
website:
type: string
format: URL
example: "https://spongepowered.org/"
description: The website URL (optional)
issues:
type: string
format: URL
example: "https://github.com/SpongePowered/Sponge/issues"
description: The issues/tracker URL (optional)
VersionInfo:
type: object
properties:
coordinates:
type: object
properties:
groupId:
type: string
example: "org.spongepowered"
artifactId:
type: string
example: "spongeforge"
version:
type: string
example: "1.16.5-36.2.5-8.1.0-RC1331"
commit:
type: object
properties:
commits:
type: array
items:
type: object
properties:
commit:
$ref: '#/components/schemas/Commit'
submoduleCommits:
type: array
items:
$ref: '#/components/schemas/Commit'
assets:
type: array
items:
$ref: '#/components/schemas/Asset'
tags:
type: object
additionalProperties:
type: string
example:
minecraft: "1.16.5"
forge: "36.2.5"
api: "8.1"
recommended:
type: boolean
description: Whether the artifact is considered a "standard release" version or if it is still in development.
example: false
VersionSchema:
type: object
required:
- variants
properties:
use_mojang_manifest:
type: boolean
description: Whether to fetch Mojang version manifest for Minecraft version ordering
default: false
variants:
type: array
minItems: 1
items:
type: object
required:
- name
- pattern
- segments
properties:
name:
type: string
description: Human-readable variant name (e.g. "current", "beta-era")
example: "current"
pattern:
type: string
description: Regex with named capture groups for version parsing
example: "^(?P<minecraft>\\d+\\.\\d+(?:\\.\\d+)?)-(?P<api>\\d+\\.\\d+\\.\\d+)$"
segments:
type: array
items:
type: object
required:
- name
- parse_as
properties:
name:
type: string
description: Named capture group to match
parse_as:
type: string
enum: [minecraft, dotted, integer, ignore]
description: How to parse and compare this segment
tag_key:
type: string
description: If set, produces a version tag with this key
parameters:
GroupID:
name: groupID
in: path
schema:
type: string
description: The maven style group coordinates
required: true
ArtifactID:
name: artifactID
in: path
schema:
type: string
description: The maven style artifact id
required: true
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Admin API token passed via ADMIN_API_TOKEN env var