summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api-spec/api.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-api-spec/api.yaml')
-rw-r--r--rust/fatcat-api-spec/api.yaml162
1 files changed, 64 insertions, 98 deletions
diff --git a/rust/fatcat-api-spec/api.yaml b/rust/fatcat-api-spec/api.yaml
index eb0528d5..0f52a8b6 100644
--- a/rust/fatcat-api-spec/api.yaml
+++ b/rust/fatcat-api-spec/api.yaml
@@ -54,6 +54,24 @@ x-orcid: &FATCATORCID
pattern: "\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]"
minLength: 19
maxLength: 19
+x-md5: &FATCATMD5
+ type: string
+ example: "1b39813549077b2347c0f370c3864b40"
+ pattern: "[a-f0-9]{32}"
+ minLength: 32
+ maxLength: 32
+x-sha1: &FATCATSHA1
+ type: string
+ example: "e9dd75237c94b209dc3ccd52722de6931a310ba3"
+ pattern: "[a-f0-9]{40}"
+ minLength: 40
+ maxLength: 40
+x-sha256: &FATCATSHA256
+ type: string
+ example: "cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452"
+ pattern: "[a-f0-9]{64}"
+ minLength: 64
+ maxLength: 64
# Common properties across entities
x-entity-props: &ENTITYPROPS
@@ -136,17 +154,11 @@ definitions:
example: 1048576
format: int64
md5:
- type: string
- #format: custom
- example: "d41efcc592d1e40ac13905377399eb9b"
+ <<: *FATCATMD5
sha1:
- type: string
- #format: custom
- example: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8"
+ <<: *FATCATSHA1
sha256:
- type: string
- #format: custom
- example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
+ <<: *FATCATSHA256
urls:
type: array
items:
@@ -168,8 +180,7 @@ definitions:
release_ids:
type: array
items:
- type: string
- #format: uuid
+ <<: *FATCATIDENT
fileset_entity:
type: object
properties:
@@ -191,17 +202,11 @@ definitions:
example: 1048576
format: int64
md5:
- type: string
- #format: custom
- example: "d41efcc592d1e40ac13905377399eb9b"
+ <<: *FATCATMD5
sha1:
- type: string
- #format: custom
- example: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8"
+ <<: *FATCATSHA1
sha256:
- type: string
- #format: custom
- example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
+ <<: *FATCATSHA256
extra:
type: object
additionalProperties: {}
@@ -223,8 +228,7 @@ definitions:
release_ids:
type: array
items:
- type: string
- #format: uuid
+ <<: *FATCATIDENT
webcapture_entity:
type: object
properties:
@@ -248,6 +252,7 @@ definitions:
example: "20020429162520"
url:
type: string
+ # NOTE: not format:url to allow alternatives
example: "http://www.asheesh.org:80/APUS/ch1/node15.html"
mimetype:
type: string
@@ -257,13 +262,9 @@ definitions:
example: 200
format: int64
sha1:
- type: string
- #format: custom
- example: "3f242a192acc258bdfdb151943419437f440c313"
+ <<: *FATCATSHA1
sha256:
- type: string
- #format: custom
- example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
+ <<: *FATCATSHA256
archive_urls:
type: array
items:
@@ -281,7 +282,7 @@ definitions:
example: "wayback"
original_url:
type: string
- #format: url
+ format: url
example: "http://asheesh.org"
timestamp:
type: string
@@ -289,8 +290,7 @@ definitions:
release_ids:
type: array
items:
- type: string
- #format: uuid
+ <<: *FATCATIDENT
release_entity:
type: object
# required for creation: title
@@ -378,8 +378,7 @@ definitions:
type: object
properties:
sha1:
- type: string
- example: "3f242a192acc258bdfdb151943419437f440c313"
+ <<: *FATCATSHA1
content:
type: string
example: "<jats:p>Some abstract thing goes here</jats:p>"
@@ -414,27 +413,17 @@ definitions:
- editgroup_id
properties:
edit_id:
- type: integer
- example: 847
- format: int64
+ <<: *FATCATUUID
ident:
- type: string
- example: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ <<: *FATCATIDENT
revision:
- type: string
- #format: uuid
- example: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
+ <<: *FATCATUUID
prev_revision:
- type: string
- #format: uuid
- example: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
+ <<: *FATCATUUID
redirect_ident:
- type: string
- example: "q3nouwy3nnbsvo3h5klxsx4a7y"
- #format: ident
+ <<: *FATCATIDENT
editgroup_id:
- type: string
- example: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ <<: *FATCATIDENT
extra:
type: object
additionalProperties: {}
@@ -444,8 +433,7 @@ definitions:
- username
properties:
editor_id:
- type: string
- example: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ <<: *FATCATIDENT
username:
type: string
example: "zerocool93"
@@ -519,8 +507,7 @@ definitions:
type: integer
format: int64
target_release_id:
- type: string
- #format: ident
+ <<: *FATCATIDENT
extra:
type: object
additionalProperties: {}
@@ -689,9 +676,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_container_revision"
tags: # TAGLINE
@@ -792,9 +778,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -808,9 +793,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit
@@ -935,9 +919,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_creator_revision"
tags: # TAGLINE
@@ -1061,9 +1044,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -1077,9 +1059,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit
@@ -1204,9 +1185,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_file_revision"
tags: # TAGLINE
@@ -1278,16 +1258,16 @@ paths:
parameters:
- name: md5
in: query
- type: string
required: false
+ <<: *FATCATMD5
- name: sha1
in: query
- type: string
required: false
+ <<: *FATCATSHA1
- name: sha256
in: query
- type: string
required: false
+ <<: *FATCATSHA256
- name: expand
in: query
type: string
@@ -1312,9 +1292,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -1328,9 +1307,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit
@@ -1455,9 +1433,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_fileset_revision"
tags: # TAGLINE
@@ -1529,9 +1506,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -1545,9 +1521,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit
@@ -1672,9 +1647,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_webcapture_revision"
tags: # TAGLINE
@@ -1746,9 +1720,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -1762,9 +1735,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit
@@ -1889,9 +1861,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_release_revision"
tags: # TAGLINE
@@ -2078,9 +2049,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -2094,9 +2064,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit
@@ -2221,9 +2190,8 @@ paths:
parameters:
- name: rev_id
in: path
- type: string
- #format: uuid
required: true
+ <<: *FATCATUUID
get:
operationId: "get_work_revision"
tags: # TAGLINE
@@ -2318,9 +2286,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Found Edit
@@ -2334,9 +2301,8 @@ paths:
parameters:
- name: edit_id
in: path
- type: integer
- format: int64
required: true
+ <<: *FATCATUUID
responses:
200:
description: Deleted Edit