-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2982 lines (2878 loc) · 96.6 KB
/
openapi.yaml
File metadata and controls
2982 lines (2878 loc) · 96.6 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
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: WREN
version: 0.1.0
description: |
WREN is a self-hosted versioned JSON storage service.
Every mutation creates a version. Versions can be labeled (e.g. `published`, `draft`).
All responses are streamed. Security and multi-tenancy are built in.
**Clean public URLs:** `/orgs/{slug}/...` is a short alias for `/api/v1/orgs/{slug}/...`,
intended for browser-facing URLs. For example, `/orgs/acme/tree/site/index.html` opens
directly in a browser without needing to know the `/api/v1` prefix.
**Caching.** Public read endpoints emit `Cache-Control: public, max-age=60,
stale-while-revalidate=86400` — browsers and CDNs can serve responses for a minute without
checking, and may serve stale responses for up to a day while revalidating in the background.
Tree and raw-asset responses also emit `Vary: Accept` so content-negotiated URLs (the ones
that can return either JSON metadata or raw bytes) are cached separately per Accept header —
a JSON probe cannot poison the HTML response for the same URL. WREN dispatches an explicit
cache purge to its configured CDN backend (default: no-op) after every successful mutation,
so edits are visible to readers within the freshness window.
**HEAD requests.** Every `GET` endpoint also responds to `HEAD` with the same status and
headers and an empty body (per RFC 7231). Useful for probing existence, cache validation, or
checking `Content-Length` without downloading the payload.
servers:
- url: http://localhost:4000
description: Local sandbox
tags:
- name: auth
description: Authentication — email/password and OAuth providers (handled by Better Auth)
- name: documents
description: Create, read, update and delete JSON documents
- name: versions
description: Version history, rollback and time-travel
- name: labels
description: Named pointers into version history
- name: diff
description: Compare versions
- name: schemas
description: JSON Schema enforcement per collection
- name: query
description: Filter, project, and aggregate documents — replaces hand-built index docs
- name: materialized
description: Named, persisted query results that auto-refresh on write
- name: assets
description: Binary asset upload, versioning and download for collections with `collectionType=binary`
- name: keys
description: API key management for server-to-server authentication
- name: org
description: Read and switch the active org for the current session
- name: invites
description: Invite collaborators to share your workspace
- name: members
description: Manage members of your org
- name: projects
description: Public project directory — lists all orgs with public permissions
- name: system
description: Health and metadata
- name: discovery
description: LLM and crawler discovery endpoints
paths:
/api/auth/sign-up/email:
post:
summary: Register with email and password
tags: [auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [email, password, name]
properties:
email:
type: string
format: email
password:
type: string
name:
type: string
responses:
"200":
description: User created and session started
"422":
description: Validation error or email already in use
/api/auth/sign-in/email:
post:
summary: Sign in with email and password
tags: [auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [email, password]
properties:
email:
type: string
format: email
password:
type: string
responses:
"200":
description: Session created
"401":
description: Invalid credentials
/api/auth/sign-out:
post:
summary: Sign out and invalidate session
tags: [auth]
responses:
"200":
description: Session invalidated
/api/auth/get-session:
get:
summary: Get current session and user info
tags: [auth]
responses:
"200":
description: Current session
content:
application/json:
schema:
type: object
properties:
user:
type: object
properties:
id:
type: string
email:
type: string
name:
type: string
role:
type: string
orgId:
type: string
session:
type: object
"401":
description: Not authenticated
/api/auth/sign-in/social:
post:
summary: Initiate OAuth sign-in (Google, Apple, GitHub)
tags: [auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [provider, callbackURL]
properties:
provider:
type: string
enum: [google, apple, github]
callbackURL:
type: string
responses:
"200":
description: Redirect URL for OAuth flow
/login:
get:
summary: Login and registration UI
tags: [auth]
responses:
"200":
description: HTML login/register page
content:
text/html:
schema:
type: string
/profile:
get:
summary: Get current user's profile
tags: [auth]
security:
- cookieAuth: []
responses:
"200":
description: Authenticated user profile
content:
application/json:
schema:
type: object
properties:
user:
type: object
properties:
id:
type: string
email:
type: string
name:
type: string
role:
type: string
orgId:
type: string
nullable: true
emailVerified:
type: boolean
"302":
description: "Redirect to /login?redirect=/profile (browser requests only)"
"401":
description: "Not authenticated (API requests with Accept: application/json)"
/health:
get:
summary: Health check
tags: [system]
responses:
"200":
description: Service is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
/api/v1/collections:
get:
summary: List all collections with document counts
tags: [documents]
security:
- cookieAuth: []
responses:
"200":
description: List of collections
content:
application/json:
schema:
type: object
properties:
collections:
type: array
items:
type: object
properties:
name:
type: string
count:
type: integer
updatedAt:
type: string
format: date-time
"401":
description: Not authenticated
/api/v1/{collection}:
get:
summary: List documents
tags: [documents]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- name: filter
in: query
description: JSON path-based filter expression
schema:
type: string
- name: limit
in: query
schema:
type: integer
default: 20
- name: cursor
in: query
description: Pagination cursor from previous response
schema:
type: string
- name: facets
in: query
description: Comma-separated list of fields to facet on
schema:
type: string
- name: label
in: query
description: Return documents at the state of this label
schema:
type: string
responses:
"200":
description: Paginated list of documents
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentList"
post:
summary: Create a document or upload a binary asset
description: |
For JSON collections send `Content-Type: application/json`.
For binary collections (`collectionType=binary`) send `Content-Type: multipart/form-data`
with a single `file` field containing the binary file.
tags: [documents, assets]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
requestBody:
required: true
content:
application/json:
schema:
type: object
multipart/form-data:
schema:
type: object
required: [file]
properties:
file:
type: string
format: binary
description: The binary file to upload
responses:
"201":
description: Document created / asset uploaded
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"400":
description: Missing file field (binary upload)
"422":
$ref: "#/components/responses/SchemaValidationError"
/api/v1/{collection}/{id}:
get:
summary: Get current state of a document
tags: [documents]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
- name: label
in: query
description: Return state at this label instead of latest
schema:
type: string
responses:
"200":
description: Document found
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"404":
$ref: "#/components/responses/NotFound"
put:
summary: Update a document or replace a binary asset (creates a new version)
description: |
For JSON collections send `Content-Type: application/json`.
For binary collections (`collectionType=binary`) send `Content-Type: multipart/form-data`
with a single `file` field containing the new binary file.
tags: [documents, assets]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
requestBody:
required: true
content:
application/json:
schema:
type: object
multipart/form-data:
schema:
type: object
required: [file]
properties:
file:
type: string
format: binary
description: The new binary file to store as the next version
responses:
"200":
description: Document updated / new asset version stored
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"400":
description: Missing file field (binary upload)
"404":
$ref: "#/components/responses/NotFound"
"422":
$ref: "#/components/responses/SchemaValidationError"
delete:
summary: Soft delete a document (creates a tombstone version)
tags: [documents]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
responses:
"200":
description: Document deleted
content:
application/json:
schema:
type: object
properties:
id:
type: string
deleted:
type: boolean
"404":
$ref: "#/components/responses/NotFound"
/api/v1/{collection}/by-key/{keyValue}:
get:
summary: Get a document by its natural key
description: |
Fetches a document by its configured natural key value (e.g. a `slug`). The collection
must have a `naturalKey` field set on its schema, otherwise this endpoint returns `400`.
The lookup uses a unique index on `(collection, natural_key)`, so it's as fast as a
by-ID lookup.
tags: [documents]
security:
- cookieAuth: []
- bearerAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- name: keyValue
in: path
required: true
schema:
type: string
description: The natural-key value (URL-encoded if it contains reserved characters)
example: "about"
- name: label
in: query
description: Return state at this label instead of latest
schema:
type: string
responses:
"200":
description: Document found
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"400":
description: Collection has no `naturalKey` configured
"404":
description: No document with that natural key
put:
summary: Upsert a document by natural key (create if missing, update if present)
description: |
The headline operation. In a single transactional call, either creates a new document
with the given natural key or updates the existing one. Replaces the
list-then-find-then-put idiom that every ingestion script otherwise reinvents.
The request body should be a JSON document. If the body contains a value for the
natural-key field (e.g. `{"slug": "about", ...}`), it must match `{keyValue}` in the
URL — otherwise the request is rejected with `400` to surface the client-side bug
where the URL and the content disagree. If the body omits the key field, the server
fills it in automatically from the URL so the stored doc stays in sync with its
addressable identity.
Returns `201` on insert, `200` on update. The response body contains the document's
stable UUID `id` (which clients may or may not care about), the current version, and
the `naturalKey` value used.
Requires `write` access to `collection:{collection}`. Schema validation still applies.
tags: [documents]
security:
- cookieAuth: []
- bearerAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- name: keyValue
in: path
required: true
schema:
type: string
example: "about"
requestBody:
required: true
content:
application/json:
schema:
type: object
description: The document data. May include the natural-key field (must match URL) or omit it (server fills it in).
responses:
"200":
description: Existing document updated
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"201":
description: New document created
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"400":
description: Collection has no `naturalKey` configured, or URL key mismatches body field
"409":
description: Unique-key conflict (race under unusual isolation; should not happen in normal use)
"422":
$ref: "#/components/responses/SchemaValidationError"
delete:
summary: Delete a document by its natural key
description: |
Soft-deletes the document whose natural-key value matches `{keyValue}`. The key slot
is released on delete (the partial unique index excludes soft-deleted rows), so you
can recreate a document under the same key afterwards.
tags: [documents]
security:
- cookieAuth: []
- bearerAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- name: keyValue
in: path
required: true
schema:
type: string
responses:
"200":
description: Document deleted
content:
application/json:
schema:
type: object
properties:
id:
type: string
deleted:
type: boolean
"400":
description: Collection has no `naturalKey` configured
"404":
description: No document with that natural key
/api/v1/{collection}/{id}/raw:
get:
summary: Download the binary content of an asset document
description: |
Returns the raw binary data for the latest version of an asset in a `collectionType=binary`
collection. Pass `?version=N` to retrieve a specific historical version.
The response `Content-Type` matches the MIME type recorded at upload time.
An optional filename suffix can be appended to the URL path for better download naming
in browsers and tools — the server ignores the suffix but the browser uses it:
```
GET /api/v1/images/{id}/raw/photo.jpg
```
tags: [assets]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
- name: version
in: query
required: false
schema:
type: integer
description: Version number to retrieve (defaults to latest)
responses:
"200":
description: Binary file content
headers:
Content-Type:
schema:
type: string
description: MIME type recorded at upload time
Content-Disposition:
schema:
type: string
description: "`inline; filename=\"<original-filename>\"`"
Cache-Control:
schema:
type: string
description: "`public, max-age=31536000, immutable`"
content:
"*/*":
schema:
type: string
format: binary
"404":
$ref: "#/components/responses/NotFound"
/api/v1/{collection}/{id}/paths:
get:
summary: List all tree paths this document is assigned to
tags: [documents]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
responses:
"200":
description: Tree path assignments for this document
content:
application/json:
schema:
type: object
properties:
id:
type: string
collection:
type: string
paths:
type: array
items:
type: object
properties:
tree:
type: string
example: main
path:
type: string
example: /site/about
"404":
$ref: "#/components/responses/NotFound"
/api/v1/{collection}/{id}/versions:
get:
summary: List version history of a document
tags: [versions]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
responses:
"200":
description: Version history
content:
application/json:
schema:
type: object
properties:
collection:
type: string
id:
type: string
versions:
type: array
items:
$ref: "#/components/schemas/VersionMeta"
/api/v1/{collection}/{id}/versions/{version}:
get:
summary: Get document state at a specific version
tags: [versions]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/version"
responses:
"200":
description: Document at specified version
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentResponse"
"404":
$ref: "#/components/responses/NotFound"
/api/v1/{collection}/{id}/rollback/{version}:
post:
summary: Rollback document to a previous version (creates a new version)
description: |
Copies the data from version `{version}` into a new version at the head of the document.
The old versions are preserved — rollback is just another write, not a delete.
**Schema is not enforced on rollback.** If the collection's schema has been tightened
since the target version was written, the rollback still succeeds — the old data is
written verbatim as a new version without being run through the validator. The next
`PUT` on that document, however, must satisfy the current schema. This is intentional
(rollback is a history replay, not a new edit) but worth knowing before you rely on
schemas for hard invariants.
tags: [versions]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/version"
responses:
"200":
description: Rollback successful — a new version is created with the old content
content:
application/json:
schema:
type: object
properties:
id:
type: string
version:
type: integer
description: The new version number created by the rollback
rolledBackTo:
type: integer
description: The source version whose content was restored
/api/v1/{collection}/{id}/labels:
post:
summary: Set a label on the current version
tags: [labels]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [label]
properties:
label:
type: string
example: published
version:
type: integer
description: Version to label (defaults to current version if omitted)
responses:
"200":
description: Label set
content:
application/json:
schema:
type: object
properties:
id:
type: string
label:
type: string
version:
type: integer
description: The version the label now points to
/api/v1/{collection}/{id}/diff:
get:
summary: Diff between two versions or labels
tags: [diff]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/id"
- name: v1
in: query
required: true
description: Version number
schema:
type: integer
- name: v2
in: query
required: true
description: Version number
schema:
type: integer
responses:
"200":
description: Diff result
content:
application/json:
schema:
type: object
properties:
id:
type: string
collection:
type: string
v1:
type: integer
v2:
type: integer
diff:
type: array
items:
$ref: "#/components/schemas/DiffEntry"
/api/v1/{collection}/_schema:
get:
summary: Get the JSON Schema, display name rule and collection type
tags: [schemas]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
responses:
"200":
description: Schema found
content:
application/json:
schema:
type: object
properties:
collection:
type: string
collectionType:
type: string
enum: [json, binary]
description: "`json` (default) stores JSON documents; `binary` stores file uploads."
schema:
type: object
nullable: true
description: A JSON Schema object. `null` for binary collections.
displayName:
type: string
nullable: true
description: |
Template for building a human-readable display name from document fields.
Use `{fieldName}` placeholders, e.g. `"{title}"` or `"{first} {last}"`.
example: "{title}"
listColumns:
type: array
nullable: true
items:
type: string
description: |
Field names to display as extra columns in the Admin UI document list.
e.g. `["date", "venue", "status"]`
example: ["date", "venue"]
naturalKey:
type: string
nullable: true
description: |
The top-level field in document data whose value becomes the document's
addressable natural key. Enables `/by-key/{value}` lookups and upsert-by-key.
Example: `"slug"` — then `PUT /api/v1/pages/by-key/about` upserts the doc
whose `data.slug === "about"`.
example: "slug"
updatedAt:
type: string
format: date-time
"404":
$ref: "#/components/responses/NotFound"
put:
summary: Set the JSON Schema, display name rule, list columns and/or collection type
description: |
Accepts a wrapper object with optional `schema`, `displayName`, `listColumns` and `collectionType` fields,
or a raw JSON Schema object (backward-compatible plain form).
Set `collectionType` to `"binary"` to mark a collection as a binary asset store —
validation is skipped and uploads use `multipart/form-data`.
**Existing documents are not re-validated.** Setting or changing a schema only affects
subsequent writes. Existing documents that no longer match the new schema are
grandfathered — reads continue to return them as-is, but any `PUT` to one of those
documents must bring it into compliance or it will be rejected with `422`. Rollback is
also unvalidated: `POST /api/v1/{collection}/{id}/rollback/{v}` writes a new version
containing the old data without checking the current schema, so you can roll a document
back to a pre-schema version even after tightening the rules. There is currently no
bulk re-validation or migration tool; tighten schemas with care on collections that
already hold data.
tags: [schemas]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- description: "Wrapper form — schema + optional displayName + optional listColumns + optional naturalKey + optional collectionType"
type: object
properties:
schema:
type: object
description: A valid JSON Schema object (omit for binary collections)
displayName:
type: string
nullable: true
description: Display name template, e.g. "{title}" or "{first} {last}"
example: "{title}"
listColumns:
type: array
nullable: true
items:
type: string
description: Field names to show as columns in the Admin UI document list
example: ["date", "venue"]
naturalKey:
type: string
nullable: true
description: |
The top-level data field whose value becomes each document's stable
addressable identity. Enables the `/by-key/{value}` routes and the
upsert-by-key operation. Pass an empty string or omit to disable.
example: "slug"
collectionType:
type: string
enum: [json, binary]
description: "`json` (default) or `binary`"
- description: "Plain form — raw JSON Schema (displayName, listColumns, naturalKey, and collectionType unchanged)"
type: object
responses:
"200":
description: Schema saved
content:
application/json:
schema:
type: object
properties:
collection:
type: string
collectionType:
type: string
enum: [json, binary]
schema:
type: object
nullable: true
displayName:
type: string
nullable: true
listColumns:
type: array
nullable: true
items:
type: string
naturalKey:
type: string
nullable: true
"422":
description: Invalid JSON Schema
delete:
summary: Remove the JSON Schema from a collection
tags: [schemas]
security:
- cookieAuth: []
parameters:
- $ref: "#/components/parameters/collection"
responses:
"200":
description: Schema removed
content:
application/json:
schema:
type: object
properties:
collection:
type: string
deleted:
type: boolean
"404":
$ref: "#/components/responses/NotFound"
/api/v1/{collection}/_schema/validate:
get:
summary: Dry-run the current schema against every existing document
description: |
Runs the collection's currently-stored JSON Schema against every existing document at
its current version and reports which documents would fail. This is a read-only
operation — nothing is mutated, no new version is created, and the stored schema is
untouched.
Use `POST` with a request body instead to dry-run a **proposed** schema that is not
yet set, which is the intended "what happens if I tighten this" safety check before
calling `PUT /api/v1/{collection}/_schema`.
Requires `read` access to `collection:{name}`. Schema changes still require `admin`.
tags: [schemas]
security:
- cookieAuth: []
- bearerAuth: []
parameters:
- $ref: "#/components/parameters/collection"
- name: max