@nasebanal/cli 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1574 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: NASEBANAL Specs API
4
+ description: "Backend of the own API specs on the NASEBANAL API Specs site. A person on the Free plan keeps up to 20 specs of their own; an organization on the Enterprise plan keeps up to 100. Either uploads OpenAPI documents, keeps their versions and reads them in the same reference view as the NASEBANAL APIs. A spec belongs to exactly one owner, the person or the organization: every request names it in `X-Active-Organization-Id` (an organization id, or `personal`), and only the owner (for an organization, its members) can see or change its specs. Authenticates users via Auth0 JWT and Personal Access Tokens (PAT) and integrates with the Account API (membership and the Enterprise subscription). Every response is wrapped as `{ success, data }` (or `{ success: false, error }`)."
5
+ version: 1.3.0
6
+ contact:
7
+ name: NASEBANAL
8
+ url: https://www.nasebanal.com
9
+ servers:
10
+ - url: http://localhost:8792
11
+ description: Local dev (wrangler dev)
12
+ - url: https://api.specs.nasebanal.com
13
+ description: Production
14
+ security:
15
+ - BearerAuth: []
16
+ tags:
17
+ - name: Health
18
+ description: Health check endpoints
19
+ - name: Access
20
+ description: Whether the active owner (the person or the organization) may use the feature
21
+ - name: Groups
22
+ description: "Groups: the boxes specs are filed in. A group is created first, then specs are registered inside it"
23
+ - name: Repositories
24
+ description: "Repositories: where the owner's APIs are implemented, and the parent of their specs. A monorepo is one repository with several specs. Registered by name from a pipeline or a screen; the id it returns is what the pipeline passes on."
25
+ - name: Specs
26
+ description: An owner's named OpenAPI documents, each filed in one of the owner's groups
27
+ - name: Versions
28
+ description: Immutable versions of a spec, one per upload
29
+ - name: Docs
30
+ description: "The description document of a spec: one markdown page the catalog renders next to the API reference"
31
+ - name: Public
32
+ description: Read-only links to the latest version of a spec for the people who consume the API
33
+ paths:
34
+ /api/v1/health:
35
+ get:
36
+ tags:
37
+ - Health
38
+ operationId: getHealth
39
+ summary: Health check
40
+ description: Returns the health status of the API.
41
+ security: []
42
+ responses:
43
+ "200":
44
+ description: API is healthy
45
+ content:
46
+ application/json:
47
+ schema:
48
+ type: object
49
+ required:
50
+ - success
51
+ - data
52
+ properties:
53
+ success:
54
+ type: boolean
55
+ enum:
56
+ - true
57
+ data:
58
+ type: object
59
+ required:
60
+ - status
61
+ - timestamp
62
+ properties:
63
+ status:
64
+ type: string
65
+ example: ok
66
+ timestamp:
67
+ type: string
68
+ format: date-time
69
+ examples:
70
+ valid:
71
+ value:
72
+ success: true
73
+ data:
74
+ status: ok
75
+ timestamp: 2026-05-14T12:00:00Z
76
+ /api/v1/access:
77
+ get:
78
+ tags:
79
+ - Access
80
+ operationId: getAccess
81
+ summary: Get access for the active owner
82
+ description: "Tells a screen what to show: the full feature, an upgrade notice, or nothing to do here. A person (`personal`) is always allowed, with `max_specs` 20; an organization is allowed with `max_specs` 100 when the caller is a member and it is on the Enterprise plan, and otherwise answers `allowed: false` with `max_specs` 0. Never refuses for a missing plan - that is what `allowed: false` is for - so the screen can explain instead of showing an error. The other endpoints enforce the plan again and answer `403 ENTERPRISE_REQUIRED` for an organization."
83
+ parameters:
84
+ - $ref: "#/components/parameters/ActiveOrganization"
85
+ responses:
86
+ "200":
87
+ description: Access
88
+ content:
89
+ application/json:
90
+ schema:
91
+ type: object
92
+ required:
93
+ - success
94
+ - data
95
+ properties:
96
+ success:
97
+ type: boolean
98
+ enum:
99
+ - true
100
+ data:
101
+ $ref: "#/components/schemas/Access"
102
+ "400":
103
+ $ref: "#/components/responses/ValidationError"
104
+ "401":
105
+ $ref: "#/components/responses/Unauthorized"
106
+ "403":
107
+ $ref: "#/components/responses/Forbidden"
108
+ /api/v1/groups:
109
+ parameters:
110
+ - $ref: "#/components/parameters/ActiveOrganization"
111
+ get:
112
+ tags:
113
+ - Groups
114
+ operationId: listGroups
115
+ summary: List groups
116
+ description: The owner's groups in order (oldest first), each with the number of specs in it.
117
+ responses:
118
+ "200":
119
+ description: Groups
120
+ content:
121
+ application/json:
122
+ schema:
123
+ type: object
124
+ required:
125
+ - success
126
+ - data
127
+ properties:
128
+ success:
129
+ type: boolean
130
+ enum:
131
+ - true
132
+ data:
133
+ type: object
134
+ required:
135
+ - data
136
+ - total
137
+ - limit
138
+ properties:
139
+ data:
140
+ type: array
141
+ items:
142
+ $ref: "#/components/schemas/Group"
143
+ total:
144
+ type: integer
145
+ limit:
146
+ type: integer
147
+ description: Maximum groups for the owner
148
+ "400":
149
+ $ref: "#/components/responses/ValidationError"
150
+ "401":
151
+ $ref: "#/components/responses/Unauthorized"
152
+ "403":
153
+ $ref: "#/components/responses/Forbidden"
154
+ post:
155
+ tags:
156
+ - Groups
157
+ operationId: createGroup
158
+ summary: Create a group
159
+ description: Creates a group from a name. The name is unique among the owner's groups, ignoring case. Beyond the maximum number of groups an owner may hold the answer is `409 LIMIT_REACHED`.
160
+ requestBody:
161
+ required: true
162
+ content:
163
+ application/json:
164
+ schema:
165
+ $ref: "#/components/schemas/GroupCreate"
166
+ responses:
167
+ "201":
168
+ description: Created group
169
+ content:
170
+ application/json:
171
+ schema:
172
+ type: object
173
+ required:
174
+ - success
175
+ - data
176
+ properties:
177
+ success:
178
+ type: boolean
179
+ enum:
180
+ - true
181
+ data:
182
+ $ref: "#/components/schemas/Group"
183
+ "400":
184
+ $ref: "#/components/responses/ValidationError"
185
+ "401":
186
+ $ref: "#/components/responses/Unauthorized"
187
+ "403":
188
+ $ref: "#/components/responses/Forbidden"
189
+ "409":
190
+ $ref: "#/components/responses/Conflict"
191
+ /api/v1/groups/{id}:
192
+ parameters:
193
+ - $ref: "#/components/parameters/GroupId"
194
+ - $ref: "#/components/parameters/ActiveOrganization"
195
+ patch:
196
+ tags:
197
+ - Groups
198
+ operationId: updateGroup
199
+ summary: Update a group
200
+ description: Renames the group.
201
+ requestBody:
202
+ required: true
203
+ content:
204
+ application/json:
205
+ schema:
206
+ $ref: "#/components/schemas/GroupUpdate"
207
+ responses:
208
+ "200":
209
+ description: Updated group
210
+ content:
211
+ application/json:
212
+ schema:
213
+ type: object
214
+ required:
215
+ - success
216
+ - data
217
+ properties:
218
+ success:
219
+ type: boolean
220
+ enum:
221
+ - true
222
+ data:
223
+ $ref: "#/components/schemas/Group"
224
+ "400":
225
+ $ref: "#/components/responses/ValidationError"
226
+ "401":
227
+ $ref: "#/components/responses/Unauthorized"
228
+ "403":
229
+ $ref: "#/components/responses/Forbidden"
230
+ "404":
231
+ $ref: "#/components/responses/NotFound"
232
+ "409":
233
+ $ref: "#/components/responses/Conflict"
234
+ delete:
235
+ tags:
236
+ - Groups
237
+ operationId: deleteGroup
238
+ summary: Delete a group
239
+ description: Deletes an empty group. A group that still holds specs is refused with `409 GROUP_NOT_EMPTY` (delete the specs or move them to another group first).
240
+ responses:
241
+ "204":
242
+ description: Deleted
243
+ "401":
244
+ $ref: "#/components/responses/Unauthorized"
245
+ "403":
246
+ $ref: "#/components/responses/Forbidden"
247
+ "404":
248
+ $ref: "#/components/responses/NotFound"
249
+ "409":
250
+ $ref: "#/components/responses/Conflict"
251
+ /api/v1/repositories:
252
+ parameters:
253
+ - $ref: "#/components/parameters/ActiveOrganization"
254
+ get:
255
+ tags:
256
+ - Repositories
257
+ operationId: listRepositories
258
+ summary: List repositories
259
+ description: The owner's repositories, by provider then name, each with the number of specs tied to it.
260
+ responses:
261
+ "200":
262
+ description: Repositories
263
+ content:
264
+ application/json:
265
+ schema:
266
+ type: object
267
+ required:
268
+ - success
269
+ - data
270
+ properties:
271
+ success:
272
+ type: boolean
273
+ enum:
274
+ - true
275
+ data:
276
+ type: object
277
+ required:
278
+ - data
279
+ - total
280
+ - limit
281
+ properties:
282
+ data:
283
+ type: array
284
+ items:
285
+ $ref: "#/components/schemas/Repository"
286
+ total:
287
+ type: integer
288
+ limit:
289
+ type: integer
290
+ description: Maximum repositories for the owner
291
+ "400":
292
+ $ref: "#/components/responses/ValidationError"
293
+ "401":
294
+ $ref: "#/components/responses/Unauthorized"
295
+ "403":
296
+ $ref: "#/components/responses/Forbidden"
297
+ put:
298
+ tags:
299
+ - Repositories
300
+ operationId: upsertRepository
301
+ summary: Register a repository (idempotent)
302
+ description: "Registers a repository by `provider`, `name` and `component` (the owner's own name for a part of it; empty = the whole repository) and returns it: ONE id says which repository and which component. `201` when it was created, `200` when it was already registered (the same id, nothing changed; the name keeps the casing it was first written with). Safe to repeat on every pipeline run. Beyond the maximum number of repositories an owner may hold the answer is `409 LIMIT_REACHED`."
303
+ requestBody:
304
+ required: true
305
+ content:
306
+ application/json:
307
+ schema:
308
+ $ref: "#/components/schemas/RepositoryUpsert"
309
+ responses:
310
+ "200":
311
+ description: Repository that was already registered
312
+ content:
313
+ application/json:
314
+ schema:
315
+ type: object
316
+ required:
317
+ - success
318
+ - data
319
+ properties:
320
+ success:
321
+ type: boolean
322
+ enum:
323
+ - true
324
+ data:
325
+ $ref: "#/components/schemas/Repository"
326
+ "201":
327
+ description: Repository that was created
328
+ content:
329
+ application/json:
330
+ schema:
331
+ type: object
332
+ required:
333
+ - success
334
+ - data
335
+ properties:
336
+ success:
337
+ type: boolean
338
+ enum:
339
+ - true
340
+ data:
341
+ $ref: "#/components/schemas/Repository"
342
+ "400":
343
+ $ref: "#/components/responses/ValidationError"
344
+ "401":
345
+ $ref: "#/components/responses/Unauthorized"
346
+ "403":
347
+ $ref: "#/components/responses/Forbidden"
348
+ "409":
349
+ $ref: "#/components/responses/Conflict"
350
+ /api/v1/repositories/{id}:
351
+ parameters:
352
+ - $ref: "#/components/parameters/RepositoryId"
353
+ - $ref: "#/components/parameters/ActiveOrganization"
354
+ get:
355
+ tags:
356
+ - Repositories
357
+ operationId: getRepository
358
+ summary: Get a repository
359
+ description: One of the owner's repositories, with the number of specs tied to it. Another owner's repository is a 404.
360
+ responses:
361
+ "200":
362
+ description: Repository
363
+ content:
364
+ application/json:
365
+ schema:
366
+ type: object
367
+ required:
368
+ - success
369
+ - data
370
+ properties:
371
+ success:
372
+ type: boolean
373
+ enum:
374
+ - true
375
+ data:
376
+ $ref: "#/components/schemas/Repository"
377
+ "401":
378
+ $ref: "#/components/responses/Unauthorized"
379
+ "403":
380
+ $ref: "#/components/responses/Forbidden"
381
+ "404":
382
+ $ref: "#/components/responses/NotFound"
383
+ patch:
384
+ tags:
385
+ - Repositories
386
+ operationId: updateRepository
387
+ summary: Update a repository
388
+ description: "Renames a repository, changes its provider or renames its component (`component: null` or an empty string makes it the repository as a whole); a repository renamed on the git host keeps its id here. A key (provider, name, component) that another repository of the owner already has is `409 NAME_TAKEN`."
389
+ requestBody:
390
+ required: true
391
+ content:
392
+ application/json:
393
+ schema:
394
+ $ref: "#/components/schemas/RepositoryUpdate"
395
+ responses:
396
+ "200":
397
+ description: Updated repository
398
+ content:
399
+ application/json:
400
+ schema:
401
+ type: object
402
+ required:
403
+ - success
404
+ - data
405
+ properties:
406
+ success:
407
+ type: boolean
408
+ enum:
409
+ - true
410
+ data:
411
+ $ref: "#/components/schemas/Repository"
412
+ "400":
413
+ $ref: "#/components/responses/ValidationError"
414
+ "401":
415
+ $ref: "#/components/responses/Unauthorized"
416
+ "403":
417
+ $ref: "#/components/responses/Forbidden"
418
+ "404":
419
+ $ref: "#/components/responses/NotFound"
420
+ "409":
421
+ $ref: "#/components/responses/Conflict"
422
+ delete:
423
+ tags:
424
+ - Repositories
425
+ operationId: deleteRepository
426
+ summary: Delete a repository
427
+ description: "Deletes the repository. The specs tied to it are not deleted: they simply have no repository any more."
428
+ responses:
429
+ "204":
430
+ description: Deleted
431
+ "401":
432
+ $ref: "#/components/responses/Unauthorized"
433
+ "403":
434
+ $ref: "#/components/responses/Forbidden"
435
+ "404":
436
+ $ref: "#/components/responses/NotFound"
437
+ /api/v1/specs:
438
+ get:
439
+ tags:
440
+ - Specs
441
+ operationId: listSpecs
442
+ summary: List specs
443
+ description: The owner's specs, most recently updated first, each with its latest version.
444
+ parameters:
445
+ - $ref: "#/components/parameters/ActiveOrganization"
446
+ responses:
447
+ "200":
448
+ description: Specs
449
+ content:
450
+ application/json:
451
+ schema:
452
+ type: object
453
+ required:
454
+ - success
455
+ - data
456
+ properties:
457
+ success:
458
+ type: boolean
459
+ enum:
460
+ - true
461
+ data:
462
+ type: object
463
+ required:
464
+ - data
465
+ - total
466
+ - limit
467
+ properties:
468
+ data:
469
+ type: array
470
+ items:
471
+ $ref: "#/components/schemas/Spec"
472
+ total:
473
+ type: integer
474
+ limit:
475
+ type: integer
476
+ description: Maximum specs for the owner (20 for a person, 100 for an organization)
477
+ "400":
478
+ $ref: "#/components/responses/ValidationError"
479
+ "401":
480
+ $ref: "#/components/responses/Unauthorized"
481
+ "403":
482
+ $ref: "#/components/responses/Forbidden"
483
+ post:
484
+ tags:
485
+ - Specs
486
+ operationId: createSpec
487
+ summary: Create a spec
488
+ description: Creates the spec and its first revision from the document in `content`, optionally filed in the group `group_id` (without one the spec stands on its own, so no group has to be made first). The document is validated as OpenAPI 3.x before anything is stored; one that is not is refused with `422 INVALID_SPEC` and the reasons. The spec's API version (`api_version`, for example `v1`) is the one given, else the MAJOR of the document's `info.version` (`1.8.0` is `v1`, `v2.0` is `v2`); a version with no major to read (a calendar version such as `2023-01`) needs `api_version` said, or the request is refused with `400 API_VERSION_REQUIRED`. A new major API version is a new spec.
489
+ parameters:
490
+ - $ref: "#/components/parameters/ActiveOrganization"
491
+ requestBody:
492
+ required: true
493
+ content:
494
+ application/json:
495
+ schema:
496
+ $ref: "#/components/schemas/SpecCreate"
497
+ responses:
498
+ "201":
499
+ description: Created spec
500
+ content:
501
+ application/json:
502
+ schema:
503
+ type: object
504
+ required:
505
+ - success
506
+ - data
507
+ properties:
508
+ success:
509
+ type: boolean
510
+ enum:
511
+ - true
512
+ data:
513
+ $ref: "#/components/schemas/Spec"
514
+ "400":
515
+ $ref: "#/components/responses/ValidationError"
516
+ "401":
517
+ $ref: "#/components/responses/Unauthorized"
518
+ "403":
519
+ $ref: "#/components/responses/Forbidden"
520
+ "409":
521
+ $ref: "#/components/responses/Conflict"
522
+ "413":
523
+ $ref: "#/components/responses/TooLarge"
524
+ "422":
525
+ $ref: "#/components/responses/InvalidSpec"
526
+ /api/v1/specs/{id}:
527
+ parameters:
528
+ - $ref: "#/components/parameters/SpecId"
529
+ - $ref: "#/components/parameters/ActiveOrganization"
530
+ get:
531
+ tags:
532
+ - Specs
533
+ operationId: getSpec
534
+ summary: Get a spec
535
+ description: One spec with its latest version.
536
+ responses:
537
+ "200":
538
+ description: Spec
539
+ content:
540
+ application/json:
541
+ schema:
542
+ type: object
543
+ required:
544
+ - success
545
+ - data
546
+ properties:
547
+ success:
548
+ type: boolean
549
+ enum:
550
+ - true
551
+ data:
552
+ $ref: "#/components/schemas/Spec"
553
+ "401":
554
+ $ref: "#/components/responses/Unauthorized"
555
+ "403":
556
+ $ref: "#/components/responses/Forbidden"
557
+ "404":
558
+ $ref: "#/components/responses/NotFound"
559
+ patch:
560
+ tags:
561
+ - Specs
562
+ operationId: updateSpec
563
+ summary: Update a spec
564
+ description: Renames the spec, changes its description or moves it to another group, or out of its group (`group_id`, `null` for none). Send only the fields to change, which include the quality settings of the spec (`public_badge`, `report_access`, `rotate_quality_public_id`). The API version is fixed when the spec is created, so a different `api_version` is refused with `400` (register the other API version as a new spec). The document itself is never edited - upload a new revision instead.
565
+ requestBody:
566
+ required: true
567
+ content:
568
+ application/json:
569
+ schema:
570
+ $ref: "#/components/schemas/SpecUpdate"
571
+ responses:
572
+ "200":
573
+ description: Updated spec
574
+ content:
575
+ application/json:
576
+ schema:
577
+ type: object
578
+ required:
579
+ - success
580
+ - data
581
+ properties:
582
+ success:
583
+ type: boolean
584
+ enum:
585
+ - true
586
+ data:
587
+ $ref: "#/components/schemas/Spec"
588
+ "400":
589
+ $ref: "#/components/responses/ValidationError"
590
+ "401":
591
+ $ref: "#/components/responses/Unauthorized"
592
+ "403":
593
+ $ref: "#/components/responses/Forbidden"
594
+ "404":
595
+ $ref: "#/components/responses/NotFound"
596
+ "409":
597
+ $ref: "#/components/responses/Conflict"
598
+ delete:
599
+ tags:
600
+ - Specs
601
+ operationId: deleteSpec
602
+ summary: Delete a spec
603
+ description: Deletes the spec and every one of its versions. Cannot be undone.
604
+ responses:
605
+ "204":
606
+ description: Deleted
607
+ "401":
608
+ $ref: "#/components/responses/Unauthorized"
609
+ "403":
610
+ $ref: "#/components/responses/Forbidden"
611
+ "404":
612
+ $ref: "#/components/responses/NotFound"
613
+ /api/v1/specs/{id}/versions:
614
+ parameters:
615
+ - $ref: "#/components/parameters/SpecId"
616
+ - $ref: "#/components/parameters/ActiveOrganization"
617
+ get:
618
+ tags:
619
+ - Versions
620
+ operationId: listSpecVersions
621
+ summary: List versions of a spec
622
+ description: Newest first. The documents are not included - read one with `getSpecVersionContent`.
623
+ responses:
624
+ "200":
625
+ description: Versions
626
+ content:
627
+ application/json:
628
+ schema:
629
+ type: object
630
+ required:
631
+ - success
632
+ - data
633
+ properties:
634
+ success:
635
+ type: boolean
636
+ enum:
637
+ - true
638
+ data:
639
+ type: object
640
+ required:
641
+ - data
642
+ - total
643
+ properties:
644
+ data:
645
+ type: array
646
+ items:
647
+ $ref: "#/components/schemas/SpecVersion"
648
+ total:
649
+ type: integer
650
+ "401":
651
+ $ref: "#/components/responses/Unauthorized"
652
+ "403":
653
+ $ref: "#/components/responses/Forbidden"
654
+ "404":
655
+ $ref: "#/components/responses/NotFound"
656
+ post:
657
+ tags:
658
+ - Versions
659
+ operationId: createSpecVersion
660
+ summary: Upload a new version
661
+ description: Adds the document in `content` as the next REVISION of the spec (the number counts up inside the spec's API version). Validated like `createSpec`. A document identical to the latest revision is refused with `409 UNCHANGED` rather than stored twice. A document whose `info.version` has another major than the spec's API version (`v1` spec, `2.0.0` document) is another API version and is refused with `409 API_VERSION_MISMATCH` (register it as a new spec). A document with no major to read is accepted, the spec's API version stands.
662
+ requestBody:
663
+ required: true
664
+ content:
665
+ application/json:
666
+ schema:
667
+ $ref: "#/components/schemas/SpecVersionCreate"
668
+ responses:
669
+ "201":
670
+ description: Created version
671
+ content:
672
+ application/json:
673
+ schema:
674
+ type: object
675
+ required:
676
+ - success
677
+ - data
678
+ properties:
679
+ success:
680
+ type: boolean
681
+ enum:
682
+ - true
683
+ data:
684
+ $ref: "#/components/schemas/SpecVersion"
685
+ "400":
686
+ $ref: "#/components/responses/ValidationError"
687
+ "401":
688
+ $ref: "#/components/responses/Unauthorized"
689
+ "403":
690
+ $ref: "#/components/responses/Forbidden"
691
+ "404":
692
+ $ref: "#/components/responses/NotFound"
693
+ "409":
694
+ $ref: "#/components/responses/Conflict"
695
+ "413":
696
+ $ref: "#/components/responses/TooLarge"
697
+ "422":
698
+ $ref: "#/components/responses/InvalidSpec"
699
+ /api/v1/specs/{id}/versions/{version}/content:
700
+ parameters:
701
+ - $ref: "#/components/parameters/SpecId"
702
+ - name: version
703
+ in: path
704
+ required: true
705
+ schema:
706
+ type: integer
707
+ minimum: 1
708
+ description: Version number, 1 for the first upload
709
+ - $ref: "#/components/parameters/ActiveOrganization"
710
+ get:
711
+ tags:
712
+ - Versions
713
+ operationId: getSpecVersionContent
714
+ summary: Read a version's document
715
+ description: The document exactly as uploaded, for the reference view and for download.
716
+ responses:
717
+ "200":
718
+ description: The OpenAPI document
719
+ content:
720
+ application/yaml:
721
+ schema:
722
+ type: string
723
+ application/json:
724
+ schema:
725
+ type: string
726
+ "401":
727
+ $ref: "#/components/responses/Unauthorized"
728
+ "403":
729
+ $ref: "#/components/responses/Forbidden"
730
+ "404":
731
+ $ref: "#/components/responses/NotFound"
732
+ /api/v1/specs/{id}/docs:
733
+ parameters:
734
+ - $ref: "#/components/parameters/SpecId"
735
+ - $ref: "#/components/parameters/ActiveOrganization"
736
+ get:
737
+ tags:
738
+ - Docs
739
+ operationId: getSpecDocs
740
+ summary: Read a spec's description document
741
+ description: The markdown exactly as uploaded. `404 NOT_FOUND` when the spec has none (`Spec.has_docs` says).
742
+ responses:
743
+ "200":
744
+ description: The markdown document
745
+ content:
746
+ text/markdown:
747
+ schema:
748
+ type: string
749
+ "401":
750
+ $ref: "#/components/responses/Unauthorized"
751
+ "403":
752
+ $ref: "#/components/responses/Forbidden"
753
+ "404":
754
+ $ref: "#/components/responses/NotFound"
755
+ put:
756
+ tags:
757
+ - Docs
758
+ operationId: putSpecDocs
759
+ summary: Write a spec's description document
760
+ description: Creates or replaces the one description document of the spec (201 when new, 200 when replaced). UTF-8 markdown, at most 200 KiB, never empty and without a NUL byte; send it as `text/markdown`. The catalog renders it next to the API reference (raw HTML in it is not rendered).
761
+ requestBody:
762
+ required: true
763
+ content:
764
+ text/markdown:
765
+ schema:
766
+ type: string
767
+ example: |
768
+ # Billing API
769
+
770
+ What it is for, how to get started.
771
+ responses:
772
+ "200":
773
+ description: Replaced
774
+ content:
775
+ application/json:
776
+ schema:
777
+ $ref: "#/components/schemas/SpecDocsWritten"
778
+ "201":
779
+ description: Created
780
+ content:
781
+ application/json:
782
+ schema:
783
+ $ref: "#/components/schemas/SpecDocsWritten"
784
+ "400":
785
+ $ref: "#/components/responses/ValidationError"
786
+ "401":
787
+ $ref: "#/components/responses/Unauthorized"
788
+ "403":
789
+ $ref: "#/components/responses/Forbidden"
790
+ "404":
791
+ $ref: "#/components/responses/NotFound"
792
+ "413":
793
+ description: The document is larger than 200 KiB
794
+ content:
795
+ application/json:
796
+ schema:
797
+ $ref: "#/components/schemas/Error"
798
+ example:
799
+ success: false
800
+ error:
801
+ code: TOO_LARGE
802
+ message: The document must be 200 KiB or smaller
803
+ "415":
804
+ description: The body is not sent as `text/markdown`
805
+ content:
806
+ application/json:
807
+ schema:
808
+ $ref: "#/components/schemas/Error"
809
+ example:
810
+ success: false
811
+ error:
812
+ code: UNSUPPORTED_MEDIA_TYPE
813
+ message: Send the document as text/markdown
814
+ delete:
815
+ tags:
816
+ - Docs
817
+ operationId: deleteSpecDocs
818
+ summary: Remove a spec's description document
819
+ description: Removes it (204, also when there was none). The spec and its versions are untouched.
820
+ responses:
821
+ "204":
822
+ description: Removed
823
+ "401":
824
+ $ref: "#/components/responses/Unauthorized"
825
+ "403":
826
+ $ref: "#/components/responses/Forbidden"
827
+ "404":
828
+ $ref: "#/components/responses/NotFound"
829
+ /api/v1/public/specs/{publicId}:
830
+ parameters:
831
+ - name: publicId
832
+ in: path
833
+ required: true
834
+ schema:
835
+ type: string
836
+ example: Xk3vQ9mT2pLw8RzYb5NcA7Fd
837
+ description: The public token of the spec (`public_id`)
838
+ get:
839
+ tags:
840
+ - Public
841
+ operationId: getPublicSpec
842
+ summary: Read a public spec
843
+ description: What the reference page shows about a spec whose `reference_access` is `public`, readable without authentication. Only the latest version is served, with no owner and no uploader. A spec that is not public and a token nobody holds both answer 404, so a private spec cannot be told from no spec. Cached for 1 minute.
844
+ security: []
845
+ responses:
846
+ "200":
847
+ description: Spec
848
+ content:
849
+ application/json:
850
+ schema:
851
+ type: object
852
+ required:
853
+ - success
854
+ - data
855
+ properties:
856
+ success:
857
+ type: boolean
858
+ enum:
859
+ - true
860
+ data:
861
+ $ref: "#/components/schemas/PublicSpec"
862
+ "404":
863
+ $ref: "#/components/responses/NotFound"
864
+ /api/v1/public/specs/{publicId}/content:
865
+ parameters:
866
+ - name: publicId
867
+ in: path
868
+ required: true
869
+ schema:
870
+ type: string
871
+ example: Xk3vQ9mT2pLw8RzYb5NcA7Fd
872
+ description: The public token of the spec (`public_id`)
873
+ get:
874
+ tags:
875
+ - Public
876
+ operationId: getPublicSpecContent
877
+ summary: Read a public spec's document
878
+ description: "The latest version of the document exactly as uploaded, for Kong Dev Portal, SDK generators and the like. Same rules as the metadata: 404 unless `reference_access` is `public`. Cached for 1 minute."
879
+ security: []
880
+ responses:
881
+ "200":
882
+ description: The OpenAPI document
883
+ content:
884
+ application/yaml:
885
+ schema:
886
+ type: string
887
+ application/json:
888
+ schema:
889
+ type: string
890
+ "404":
891
+ $ref: "#/components/responses/NotFound"
892
+ /api/v1/shared/specs/{publicId}:
893
+ parameters:
894
+ - name: publicId
895
+ in: path
896
+ required: true
897
+ schema:
898
+ type: string
899
+ example: Xk3vQ9mT2pLw8RzYb5NcA7Fd
900
+ description: The public token of the spec (`public_id`)
901
+ get:
902
+ tags:
903
+ - Public
904
+ operationId: getSharedSpec
905
+ summary: Read a spec shared with signed-in users
906
+ description: "The same for a visitor who is SIGNED IN: any NASEBANAL account with the link may read it when `reference_access` is `login` or `public`. `hidden` and an unknown token answer 404; without credentials it is a 401."
907
+ responses:
908
+ "200":
909
+ description: Spec
910
+ content:
911
+ application/json:
912
+ schema:
913
+ type: object
914
+ required:
915
+ - success
916
+ - data
917
+ properties:
918
+ success:
919
+ type: boolean
920
+ enum:
921
+ - true
922
+ data:
923
+ $ref: "#/components/schemas/PublicSpec"
924
+ "401":
925
+ $ref: "#/components/responses/Unauthorized"
926
+ "404":
927
+ $ref: "#/components/responses/NotFound"
928
+ /api/v1/shared/specs/{publicId}/content:
929
+ parameters:
930
+ - name: publicId
931
+ in: path
932
+ required: true
933
+ schema:
934
+ type: string
935
+ example: Xk3vQ9mT2pLw8RzYb5NcA7Fd
936
+ description: The public token of the spec (`public_id`)
937
+ get:
938
+ tags:
939
+ - Public
940
+ operationId: getSharedSpecContent
941
+ summary: Read a shared spec's document
942
+ description: The latest version of the document for a signed-in visitor (`login` or `public` access).
943
+ responses:
944
+ "200":
945
+ description: The OpenAPI document
946
+ content:
947
+ application/yaml:
948
+ schema:
949
+ type: string
950
+ application/json:
951
+ schema:
952
+ type: string
953
+ "401":
954
+ $ref: "#/components/responses/Unauthorized"
955
+ "404":
956
+ $ref: "#/components/responses/NotFound"
957
+ components:
958
+ securitySchemes:
959
+ BearerAuth:
960
+ type: http
961
+ scheme: bearer
962
+ bearerFormat: JWT or PAT
963
+ description: Use either an Auth0 JWT token or a Personal Access Token (PAT) starting with `nbpat_`.
964
+ parameters:
965
+ ActiveOrganization:
966
+ name: X-Active-Organization-Id
967
+ in: header
968
+ required: true
969
+ schema:
970
+ type: string
971
+ example: "7"
972
+ description: "The owner of the specs: an organization id, or `personal` for the caller's own specs (Free plan, up to 20). Required: a missing or malformed value is refused with 400 `VALIDATION_ERROR`. An organization the caller does not belong to is refused with 403 `FORBIDDEN`."
973
+ GroupId:
974
+ name: id
975
+ in: path
976
+ required: true
977
+ schema:
978
+ type: string
979
+ example: gr_01hx
980
+ description: Group id
981
+ RepositoryId:
982
+ name: id
983
+ in: path
984
+ required: true
985
+ schema:
986
+ type: string
987
+ example: rp_01hx
988
+ description: Repository id
989
+ SpecId:
990
+ name: id
991
+ in: path
992
+ required: true
993
+ schema:
994
+ type: string
995
+ example: sp_01hx
996
+ description: Spec id
997
+ schemas:
998
+ Error:
999
+ type: object
1000
+ properties:
1001
+ success:
1002
+ type: boolean
1003
+ enum:
1004
+ - false
1005
+ error:
1006
+ type: object
1007
+ properties:
1008
+ code:
1009
+ type: string
1010
+ message:
1011
+ type: string
1012
+ Access:
1013
+ type: object
1014
+ required:
1015
+ - allowed
1016
+ - reason
1017
+ - owner
1018
+ - max_specs
1019
+ - max_groups
1020
+ properties:
1021
+ allowed:
1022
+ type: boolean
1023
+ description: The owner may use the feature
1024
+ reason:
1025
+ type: string
1026
+ nullable: true
1027
+ enum:
1028
+ - enterprise_required
1029
+ - null
1030
+ description: Why not, when `allowed` is false
1031
+ owner:
1032
+ type: string
1033
+ enum:
1034
+ - user
1035
+ - organization
1036
+ description: Whose specs these are - the caller (`personal`) or the active organization
1037
+ max_specs:
1038
+ type: integer
1039
+ description: How many specs the owner may hold (0 when `allowed` is false)
1040
+ max_groups:
1041
+ type: integer
1042
+ description: How many groups the owner may hold (0 when `allowed` is false)
1043
+ Group:
1044
+ type: object
1045
+ required:
1046
+ - id
1047
+ - name
1048
+ - spec_count
1049
+ - created_at
1050
+ - updated_at
1051
+ properties:
1052
+ id:
1053
+ type: string
1054
+ example: gr_01hx
1055
+ name:
1056
+ type: string
1057
+ maxLength: 60
1058
+ example: Billing
1059
+ description: Name the owner gives the group, unique among that owner's groups
1060
+ spec_count:
1061
+ type: integer
1062
+ minimum: 0
1063
+ description: How many specs are filed in this group
1064
+ created_at:
1065
+ type: string
1066
+ format: date-time
1067
+ updated_at:
1068
+ type: string
1069
+ format: date-time
1070
+ GroupCreate:
1071
+ type: object
1072
+ required:
1073
+ - name
1074
+ properties:
1075
+ name:
1076
+ type: string
1077
+ minLength: 1
1078
+ maxLength: 60
1079
+ example: Billing
1080
+ GroupUpdate:
1081
+ type: object
1082
+ required:
1083
+ - name
1084
+ properties:
1085
+ name:
1086
+ type: string
1087
+ minLength: 1
1088
+ maxLength: 60
1089
+ Repository:
1090
+ type: object
1091
+ required:
1092
+ - id
1093
+ - provider
1094
+ - name
1095
+ - component
1096
+ - attachments_enabled
1097
+ - spec_count
1098
+ - created_at
1099
+ - updated_at
1100
+ properties:
1101
+ id:
1102
+ type: string
1103
+ example: rp_01hx
1104
+ description: Repository id; the id the pipelines and Assurance use
1105
+ provider:
1106
+ type: string
1107
+ enum:
1108
+ - github
1109
+ - gitlab
1110
+ - bitbucket
1111
+ - other
1112
+ description: Where it is hosted. `other` is for something that is not in git (a vendor's delivery) and takes any name.
1113
+ name:
1114
+ type: string
1115
+ minLength: 1
1116
+ maxLength: 200
1117
+ example: nasebanal/nb-recorder-api
1118
+ description: "`owner/name` for `github`, `gitlab` and `bitbucket` (GitLab allows subgroups: `group/sub/name`); any text for `other`. Together with the owner, the provider and the component it is the key: unique, ignoring case."
1119
+ component:
1120
+ type: string
1121
+ maxLength: 100
1122
+ default: ""
1123
+ example: account-api
1124
+ description: "The owner's own name for a part of the repository that is tested and measured on its own (a monorepo with several APIs: `account-api`, `target-api`; a web app: `web`). Free text, trimmed, at most 100 characters, no control characters. Empty (the default) is the repository as a whole. Part of the key: the same repository with another component is another row with its own id, results and specs."
1125
+ attachments_enabled:
1126
+ type: boolean
1127
+ default: false
1128
+ description: "true lets the original test report be attached to a result of this repository's CI (a report can hold secrets and every member of the namespace can download it, so it is off by default). Turning it off stops new attachments; what is stored stays until it is removed. The one quality setting a repository holds: the raw report comes from its CI; the other settings are the spec's."
1129
+ spec_count:
1130
+ type: integer
1131
+ minimum: 0
1132
+ description: How many specs are tied to this repository
1133
+ created_at:
1134
+ type: string
1135
+ format: date-time
1136
+ updated_at:
1137
+ type: string
1138
+ format: date-time
1139
+ RepositoryUpsert:
1140
+ type: object
1141
+ description: "Registers the repository, or finds it: the key is `provider`, `name` and `component` (an absent, `null` or empty `component` is the repository as a whole). Safe to repeat on every pipeline run; the same four fields (with the owner) always answer the same id. A repository holds identity (provider, name, component) and one setting, `attachments_enabled`: the public links and the rest of how results are handled are settings of the spec. An existing repository is returned as it is, so a pipeline run can never change what someone set on a screen (rename it with `PATCH`)."
1142
+ required:
1143
+ - provider
1144
+ - name
1145
+ properties:
1146
+ provider:
1147
+ type: string
1148
+ enum:
1149
+ - github
1150
+ - gitlab
1151
+ - bitbucket
1152
+ - other
1153
+ example: github
1154
+ name:
1155
+ type: string
1156
+ minLength: 1
1157
+ maxLength: 200
1158
+ example: nasebanal/nb-recorder-api
1159
+ component:
1160
+ type: string
1161
+ maxLength: 100
1162
+ default: ""
1163
+ example: account-api
1164
+ description: "The owner's own name for a part of the repository that is tested and measured on its own (a monorepo with several APIs: `account-api`, `target-api`; a web app: `web`). Free text, trimmed, at most 100 characters, no control characters. Empty (the default) is the repository as a whole. Part of the key: the same repository with another component is another row with its own id, results and specs."
1165
+ attachments_enabled:
1166
+ type: boolean
1167
+ default: false
1168
+ description: Whether the original test report may be attached to a result. Applied only when the repository is created; an existing repository is returned as it is. Default false.
1169
+ RepositoryUpdate:
1170
+ type: object
1171
+ properties:
1172
+ provider:
1173
+ type: string
1174
+ enum:
1175
+ - github
1176
+ - gitlab
1177
+ - bitbucket
1178
+ - other
1179
+ name:
1180
+ type: string
1181
+ minLength: 1
1182
+ maxLength: 200
1183
+ component:
1184
+ type: string
1185
+ maxLength: 100
1186
+ default: ""
1187
+ nullable: true
1188
+ description: "The owner's own name for a part of the repository that is tested and measured on its own (a monorepo with several APIs: `account-api`, `target-api`; a web app: `web`). Free text, trimmed, at most 100 characters, no control characters. Empty (the default) is the repository as a whole. Part of the key: the same repository with another component is another row with its own id, results and specs."
1189
+ attachments_enabled:
1190
+ type: boolean
1191
+ description: Whether the original test report may be attached to a result.
1192
+ Spec:
1193
+ type: object
1194
+ required:
1195
+ - id
1196
+ - name
1197
+ - group_id
1198
+ - repository_id
1199
+ - title
1200
+ - openapi_version
1201
+ - latest_version
1202
+ - api_version
1203
+ - reference_access
1204
+ - public_badge
1205
+ - report_access
1206
+ - quality_public_id
1207
+ - latest_contract_hash
1208
+ - has_docs
1209
+ - docs_updated_at
1210
+ - created_at
1211
+ - updated_at
1212
+ properties:
1213
+ id:
1214
+ type: string
1215
+ example: sp_01hx
1216
+ group_id:
1217
+ type: string
1218
+ nullable: true
1219
+ example: gr_01hx
1220
+ description: The group this spec is filed in; `null` = none (it stands on its own in the list)
1221
+ repository_id:
1222
+ type: string
1223
+ nullable: true
1224
+ example: rp_01hx
1225
+ description: The repository this spec is implemented in; `null` = none (for example an OAS uploaded by hand)
1226
+ name:
1227
+ type: string
1228
+ maxLength: 100
1229
+ example: Billing API
1230
+ description: "Name the owner gives the spec. Unique within the owner, the group, the repository AND the API version the spec is, ignoring case: the environments of one API are separate specs filed in different groups, and a new API version is a separate spec, so they may share a name (the same name under another repository is fine too; the specs with no group, or with no repository, count as one value each)"
1231
+ description:
1232
+ type: string
1233
+ nullable: true
1234
+ maxLength: 1000
1235
+ title:
1236
+ type: string
1237
+ description: "`info.title` of the latest version"
1238
+ openapi_version:
1239
+ type: string
1240
+ example: 3.0.3
1241
+ description: "`openapi` of the latest version"
1242
+ latest_version:
1243
+ type: integer
1244
+ minimum: 1
1245
+ description: "The number of the newest REVISION of the spec's document (1, 2, 3 ...): the history inside one API version. Every change of the document is a new revision, whether or not it breaks compatibility; the API version is `api_version`."
1246
+ api_version:
1247
+ type: string
1248
+ example: v1
1249
+ description: "The API version this spec is (`v1`, `v2`: the generation of the API, which changes only with a breaking change). Fixed when the spec is created, from the given `api_version` or the major of the document's `info.version`; a new major API version is a new spec. Results and monitors are about the spec, so they need no version of their own."
1250
+ created_by_user_id:
1251
+ type: integer
1252
+ nullable: true
1253
+ description: Who uploaded the first version; null once that account is deleted
1254
+ created_at:
1255
+ type: string
1256
+ format: date-time
1257
+ reference_access:
1258
+ type: string
1259
+ enum:
1260
+ - hidden
1261
+ - login
1262
+ - public
1263
+ description: "Who may read the latest version through the public links: `hidden` = nobody (404 whoever asks), `login` = anyone signed in to NASEBANAL who has the link, `public` = anyone with the link, no login. Only the latest version is ever served."
1264
+ public_id:
1265
+ type: string
1266
+ nullable: true
1267
+ description: The unguessable token (24 characters) of the public links; null until `reference_access` was first turned on. Kept when the access is turned off again, replaced by `rotate_public_id`.
1268
+ public_badge:
1269
+ type: boolean
1270
+ description: true makes the quality badge ("5/6" and a colour) readable without authentication by `quality_public_id`; false makes it show nothing at all. The public token (`quality_public_id`) exists from the spec's creation and does not change when the badge goes on or off. Independent of `report_access`. Read by NASEBANAL Assurance, which computes the quality from the results it holds.
1271
+ report_access:
1272
+ type: string
1273
+ enum:
1274
+ - hidden
1275
+ - login
1276
+ - public
1277
+ description: "Who may read the quality report (the summary, the report page and its embed): `hidden` = nobody (404 whoever asks), `login` = anyone signed in to NASEBANAL who has the link, `public` = anyone with the link, no login. Independent of `public_badge`."
1278
+ quality_public_id:
1279
+ type: string
1280
+ description: The unguessable token (24 characters) of the public quality links. Issued when the spec is created, so the links can be shown and copied before the badge or the report is switched on (while both are off the token opens nothing); never changed by the settings, replaced only by `rotate_quality_public_id`.
1281
+ latest_contract_hash:
1282
+ type: string
1283
+ nullable: true
1284
+ example: 3b1c0a5e4f6d7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b
1285
+ description: "SHA-256 (hex) of the CONTRACT of the latest version: its document without the top-level `servers`, in a canonical form (parsed, every object's keys sorted by code point, arrays in their own order, serialized as JSON). The environments of one API are separate specs whose documents differ in `servers` only, so equal hashes mean \"the same contract\". `null` only when the document cannot be read."
1286
+ has_docs:
1287
+ type: boolean
1288
+ description: Whether the spec has a description document (markdown), read with `GET /specs/{id}/docs`.
1289
+ docs_updated_at:
1290
+ type: string
1291
+ format: date-time
1292
+ nullable: true
1293
+ description: When the description document was last written; `null` = none.
1294
+ updated_at:
1295
+ type: string
1296
+ format: date-time
1297
+ PublicSpec:
1298
+ type: object
1299
+ description: "What the public reference page shows about a spec: its name and the latest version, nothing about who owns or uploaded it."
1300
+ required:
1301
+ - name
1302
+ - title
1303
+ - openapi_version
1304
+ - info_version
1305
+ - version
1306
+ - updated_at
1307
+ properties:
1308
+ name:
1309
+ type: string
1310
+ title:
1311
+ type: string
1312
+ description:
1313
+ type: string
1314
+ nullable: true
1315
+ openapi_version:
1316
+ type: string
1317
+ info_version:
1318
+ type: string
1319
+ version:
1320
+ type: integer
1321
+ updated_at:
1322
+ type: string
1323
+ format: date-time
1324
+ SpecDocsWritten:
1325
+ type: object
1326
+ required:
1327
+ - success
1328
+ - data
1329
+ properties:
1330
+ success:
1331
+ type: boolean
1332
+ enum:
1333
+ - true
1334
+ data:
1335
+ type: object
1336
+ required:
1337
+ - size_bytes
1338
+ - updated_at
1339
+ properties:
1340
+ size_bytes:
1341
+ type: integer
1342
+ description: Size of the stored document in bytes (UTF-8)
1343
+ updated_at:
1344
+ type: string
1345
+ format: date-time
1346
+ SpecCreate:
1347
+ type: object
1348
+ required:
1349
+ - name
1350
+ - content
1351
+ properties:
1352
+ group_id:
1353
+ type: string
1354
+ nullable: true
1355
+ example: gr_01hx
1356
+ description: "The group to file the spec in. Optional: left out (or `null`) the spec is filed in no group. A group is made with `POST /groups`; a group of another owner is a 404"
1357
+ repository_id:
1358
+ type: string
1359
+ nullable: true
1360
+ example: rp_01hx
1361
+ description: "The repository to tie the spec to. Optional: left out (or `null`) the spec has no repository. A repository is made with `PUT /repositories`; a repository of another owner is a 404"
1362
+ name:
1363
+ type: string
1364
+ minLength: 1
1365
+ maxLength: 100
1366
+ example: Billing API
1367
+ description:
1368
+ type: string
1369
+ maxLength: 1000
1370
+ content:
1371
+ type: string
1372
+ description: The OpenAPI 3.x document, YAML or JSON, as text. At most 2 MiB.
1373
+ example: |
1374
+ openapi: 3.0.3
1375
+ info:
1376
+ title: Billing API
1377
+ version: 1.0.0
1378
+ paths: {}
1379
+ api_version:
1380
+ type: string
1381
+ minLength: 1
1382
+ maxLength: 32
1383
+ pattern: ^[A-Za-z0-9._-]{1,32}$
1384
+ example: v1
1385
+ description: "The API version of the spec (letters, digits, `.`, `_`, `-`; trimmed). Optional: left out, it is the major of the document's `info.version` (`1.8.0` is `v1`). Required when `info.version` has no major to read (`2023-01`), refused with `400 API_VERSION_REQUIRED` otherwise. Fixed for the life of the spec."
1386
+ SpecUpdate:
1387
+ type: object
1388
+ properties:
1389
+ api_version:
1390
+ type: string
1391
+ pattern: ^[A-Za-z0-9._-]{1,32}$
1392
+ description: "Not changeable: the API version is fixed when the spec is created. Sending the spec's own value again is accepted; a different one is refused with `400` (a new API version is registered as a new spec)."
1393
+ group_id:
1394
+ type: string
1395
+ nullable: true
1396
+ example: gr_01hx
1397
+ description: Moves the spec to another group; `null` takes it out of its group. A group of another owner is a 404
1398
+ repository_id:
1399
+ type: string
1400
+ nullable: true
1401
+ example: rp_01hx
1402
+ description: Ties the spec to another repository; `null` takes it out. A repository of another owner is a 404
1403
+ name:
1404
+ type: string
1405
+ minLength: 1
1406
+ maxLength: 100
1407
+ description:
1408
+ type: string
1409
+ nullable: true
1410
+ maxLength: 1000
1411
+ reference_access:
1412
+ type: string
1413
+ enum:
1414
+ - hidden
1415
+ - login
1416
+ - public
1417
+ description: "Who may read the latest version through the public links: `hidden` = nobody (404 whoever asks), `login` = anyone signed in to NASEBANAL who has the link, `public` = anyone with the link, no login. Only the latest version is ever served."
1418
+ rotate_public_id:
1419
+ type: boolean
1420
+ description: true replaces the public token, which breaks every link already shared.
1421
+ public_badge:
1422
+ type: boolean
1423
+ description: true makes the quality badge ("5/6" and a colour) readable without authentication by `quality_public_id`; false makes it show nothing at all. The public token (`quality_public_id`) exists from the spec's creation and does not change when the badge goes on or off. Independent of `report_access`. Read by NASEBANAL Assurance, which computes the quality from the results it holds.
1424
+ report_access:
1425
+ type: string
1426
+ enum:
1427
+ - hidden
1428
+ - login
1429
+ - public
1430
+ description: "Who may read the quality report (the summary, the report page and its embed): `hidden` = nobody (404 whoever asks), `login` = anyone signed in to NASEBANAL who has the link, `public` = anyone with the link, no login. Independent of `public_badge`."
1431
+ rotate_quality_public_id:
1432
+ type: boolean
1433
+ description: true replaces the public token, which breaks every link already shared.
1434
+ SpecVersionCreate:
1435
+ type: object
1436
+ required:
1437
+ - content
1438
+ properties:
1439
+ content:
1440
+ type: string
1441
+ description: The OpenAPI 3.x document, YAML or JSON, as text. At most 2 MiB.
1442
+ example: |
1443
+ openapi: 3.0.3
1444
+ info:
1445
+ title: Billing API
1446
+ version: 1.1.0
1447
+ paths: {}
1448
+ note:
1449
+ type: string
1450
+ maxLength: 500
1451
+ description: What changed, shown in the version list
1452
+ SpecVersion:
1453
+ type: object
1454
+ required:
1455
+ - version
1456
+ - title
1457
+ - openapi_version
1458
+ - info_version
1459
+ - size_bytes
1460
+ - content_hash
1461
+ - contract_hash
1462
+ - created_at
1463
+ properties:
1464
+ version:
1465
+ type: integer
1466
+ minimum: 1
1467
+ description: The REVISION number of this document inside its spec. Counts up from 1 per spec; never reused
1468
+ title:
1469
+ type: string
1470
+ description: "`info.title` of this version"
1471
+ openapi_version:
1472
+ type: string
1473
+ example: 3.0.3
1474
+ info_version:
1475
+ type: string
1476
+ example: 1.1.0
1477
+ description: "`info.version` of this version, as the author wrote it"
1478
+ note:
1479
+ type: string
1480
+ nullable: true
1481
+ size_bytes:
1482
+ type: integer
1483
+ content_hash:
1484
+ type: string
1485
+ example: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
1486
+ description: SHA-256 (hex) of the document exactly as it was uploaded. The same hash of a local file means the file is already the latest version, so there is nothing to upload
1487
+ contract_hash:
1488
+ type: string
1489
+ nullable: true
1490
+ description: "SHA-256 (hex) of the contract of this version: the document without its top-level `servers`, canonical (see `Spec.latest_contract_hash`). `null` only when the document cannot be read."
1491
+ created_by_user_id:
1492
+ type: integer
1493
+ nullable: true
1494
+ created_at:
1495
+ type: string
1496
+ format: date-time
1497
+ responses:
1498
+ Unauthorized:
1499
+ description: Authentication required or invalid token
1500
+ content:
1501
+ application/json:
1502
+ schema:
1503
+ $ref: "#/components/schemas/Error"
1504
+ example:
1505
+ success: false
1506
+ error:
1507
+ code: AUTH_ERROR
1508
+ message: No authentication token provided
1509
+ ValidationError:
1510
+ description: The request body, a parameter or the active owner is invalid, or the new spec's `info.version` has no major version to take the API version from and no `api_version` was given (`API_VERSION_REQUIRED`)
1511
+ content:
1512
+ application/json:
1513
+ schema:
1514
+ $ref: "#/components/schemas/Error"
1515
+ example:
1516
+ success: false
1517
+ error:
1518
+ code: VALIDATION_ERROR
1519
+ message: X-Active-Organization-Id must be an organization id or personal
1520
+ Forbidden:
1521
+ description: The caller does not belong to the active organization (`FORBIDDEN`), or the organization is not on the Enterprise plan (`ENTERPRISE_REQUIRED`). Never returned for `personal`.
1522
+ content:
1523
+ application/json:
1524
+ schema:
1525
+ $ref: "#/components/schemas/Error"
1526
+ example:
1527
+ success: false
1528
+ error:
1529
+ code: ENTERPRISE_REQUIRED
1530
+ message: An organization's specs require the Enterprise plan
1531
+ NotFound:
1532
+ description: No such spec or version, or it belongs to another owner
1533
+ content:
1534
+ application/json:
1535
+ schema:
1536
+ $ref: "#/components/schemas/Error"
1537
+ example:
1538
+ success: false
1539
+ error:
1540
+ code: NOT_FOUND
1541
+ message: Spec not found
1542
+ Conflict:
1543
+ description: "The name is already used by another spec of the same group, repository and API version (or, with none, another spec with none) or by another group of the owner (`NAME_TAKEN`; changing `group_id` or `repository_id` into a group and repository that already hold a spec of this name and API version is the same, and so is deleting a repository whose specs would then collide), a group still holds specs (`GROUP_NOT_EMPTY`), the document is identical to the latest revision (`UNCHANGED`), the document is another API version than the spec (`API_VERSION_MISMATCH`: register it as a new spec), the owner already holds the maximum number of specs or groups (`LIMIT_REACHED`), or another upload of the same spec was in progress (`CONFLICT`, try again)"
1544
+ content:
1545
+ application/json:
1546
+ schema:
1547
+ $ref: "#/components/schemas/Error"
1548
+ example:
1549
+ success: false
1550
+ error:
1551
+ code: NAME_TAKEN
1552
+ message: A spec with this name already exists in this group, repository and API version
1553
+ TooLarge:
1554
+ description: The document is larger than 2 MiB
1555
+ content:
1556
+ application/json:
1557
+ schema:
1558
+ $ref: "#/components/schemas/Error"
1559
+ example:
1560
+ success: false
1561
+ error:
1562
+ code: TOO_LARGE
1563
+ message: The document must be 2 MiB or smaller
1564
+ InvalidSpec:
1565
+ description: The document is not a valid OpenAPI 3.x document
1566
+ content:
1567
+ application/json:
1568
+ schema:
1569
+ $ref: "#/components/schemas/Error"
1570
+ example:
1571
+ success: false
1572
+ error:
1573
+ code: INVALID_SPEC
1574
+ message: "paths: must be an object"