aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/api.yaml
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-09 10:10:42 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-09 10:10:42 -0700
commitb15eff77fdb7974ce2bf3c2e44c8edc354f9f452 (patch)
tree5bccb9ff2633eb35dc00babc0b2dd1842f02e49b /rust/fatcat-api/api.yaml
parent419bddcb0377e82e7177356350d35bf84b3e80d8 (diff)
parenta29beab0683d77086cc1b431779d0540dc5a9b49 (diff)
downloadfatcat-b15eff77fdb7974ce2bf3c2e44c8edc354f9f452.tar.gz
fatcat-b15eff77fdb7974ce2bf3c2e44c8edc354f9f452.zip
Merge branch 'http-verbs' into cockroach
Manually merged conflicts: rust/migrations/2018-05-12-001226_init/up.sql rust/src/api_server.rs rust/src/database_schema.rs
Diffstat (limited to 'rust/fatcat-api/api.yaml')
-rw-r--r--rust/fatcat-api/api.yaml254
1 files changed, 228 insertions, 26 deletions
diff --git a/rust/fatcat-api/api.yaml b/rust/fatcat-api/api.yaml
index 7ec91bad..a8919216 100644
--- a/rust/fatcat-api/api.yaml
+++ b/rust/fatcat-api/api.yaml
@@ -37,7 +37,7 @@ x-issn: &FATCATISSN
x-orcid: &FATCATORCID
type: string
example: "0000-0002-1825-0097"
- pattern: "\\d{4}-\\d{4}-\\d{4}-\\d{4}"
+ pattern: "\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]"
minLength: 19
maxLength: 19
@@ -57,6 +57,10 @@ x-entity-props: &ENTITYPROPS
extra:
type: object
additionalProperties: {}
+# TODO:
+# edit_extra:
+# type: object
+# additionalProperties: {}
definitions:
error_response:
@@ -438,6 +442,16 @@ paths:
post:
operationId: "create_container_batch"
parameters:
+ - name: autoaccept
+ in: query
+ type: boolean
+ required: false
+ description: "If true, and editor is authorized, batch is accepted all at once"
+ - name: editgroup
+ in: query
+ type: string
+ required: false
+ description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
- name: entity_list
in: body
required: true
@@ -459,19 +473,47 @@ paths:
in: path
type: string
required: true
- - name: expand
- in: query
- type: string
- required: false
- description: "List of sub-entities to expand in response. For now, only 'all' accepted."
get:
operationId: "get_container"
+ parameters:
+ - name: expand
+ in: query
+ type: string
+ required: false
+ description: "List of sub-entities to expand in response. For now, only 'all' accepted."
responses:
200:
description: Found Entity
schema:
$ref: "#/definitions/container_entity"
<<: *ENTITYRESPONSES
+ put:
+ operationId: "update_container"
+ parameters:
+ - name: entity
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/container_entity"
+ responses:
+ 200:
+ description: Updated Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ delete:
+ operationId: "delete_container"
+ parameters:
+ - name: editgroup
+ in: query
+ required: false
+ type: string
+ responses:
+ 200:
+ description: Deleted Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
/container/{id}/history:
parameters:
- name: id
@@ -526,6 +568,16 @@ paths:
post:
operationId: "create_creator_batch"
parameters:
+ - name: autoaccept
+ in: query
+ type: boolean
+ required: false
+ description: "If true, and editor is authorized, batch is accepted all at once"
+ - name: editgroup
+ in: query
+ type: string
+ required: false
+ description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
- name: entity_list
in: body
required: true
@@ -547,19 +599,47 @@ paths:
in: path
type: string
required: true
- - name: expand
- in: query
- type: string
- required: false
- description: "List of sub-entities to expand in response. For now, only 'all' accepted."
get:
operationId: "get_creator"
+ parameters:
+ - name: expand
+ in: query
+ type: string
+ required: false
+ description: "List of sub-entities to expand in response. For now, only 'all' accepted."
responses:
200:
description: Found Entity
schema:
$ref: "#/definitions/creator_entity"
<<: *ENTITYRESPONSES
+ put:
+ operationId: "update_creator"
+ parameters:
+ - name: entity
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/creator_entity"
+ responses:
+ 200:
+ description: Updated Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ delete:
+ operationId: "delete_creator"
+ parameters:
+ - name: editgroup
+ in: query
+ required: false
+ type: string
+ responses:
+ 200:
+ description: Deleted Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
/creator/{id}/history:
parameters:
- name: id
@@ -630,6 +710,16 @@ paths:
post:
operationId: "create_file_batch"
parameters:
+ - name: autoaccept
+ in: query
+ type: boolean
+ required: false
+ description: "If true, and editor is authorized, batch is accepted all at once"
+ - name: editgroup
+ in: query
+ type: string
+ required: false
+ description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
- name: entity_list
in: body
required: true
@@ -651,19 +741,47 @@ paths:
in: path
type: string
required: true
- - name: expand
- in: query
- type: string
- required: false
- description: "List of sub-entities to expand in response. For now, only 'all' accepted."
get:
operationId: "get_file"
+ parameters:
+ - name: expand
+ in: query
+ type: string
+ required: false
+ description: "List of sub-entities to expand in response. For now, only 'all' accepted."
responses:
200:
description: Found Entity
schema:
$ref: "#/definitions/file_entity"
<<: *ENTITYRESPONSES
+ put:
+ operationId: "update_file"
+ parameters:
+ - name: entity
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/file_entity"
+ responses:
+ 200:
+ description: Updated Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ delete:
+ operationId: "delete_file"
+ parameters:
+ - name: editgroup
+ in: query
+ required: false
+ type: string
+ responses:
+ 200:
+ description: Deleted Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
/file/{id}/history:
parameters:
- name: id
@@ -718,6 +836,16 @@ paths:
post:
operationId: "create_release_batch"
parameters:
+ - name: autoaccept
+ in: query
+ type: boolean
+ required: false
+ description: "If true, and editor is authorized, batch is accepted all at once"
+ - name: editgroup
+ in: query
+ type: string
+ required: false
+ description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
- name: entity_list
in: body
required: true
@@ -739,19 +867,47 @@ paths:
in: path
type: string
required: true
- - name: expand
- in: query
- type: string
- required: false
- description: "List of sub-entities to expand in response. For now, only 'all' accepted."
get:
operationId: "get_release"
+ parameters:
+ - name: expand
+ in: query
+ type: string
+ required: false
+ description: "List of sub-entities to expand in response. For now, only 'all' accepted."
responses:
200:
description: Found Entity
schema:
$ref: "#/definitions/release_entity"
<<: *ENTITYRESPONSES
+ put:
+ operationId: "update_release"
+ parameters:
+ - name: entity
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/release_entity"
+ responses:
+ 200:
+ description: Updated Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ delete:
+ operationId: "delete_release"
+ parameters:
+ - name: editgroup
+ in: query
+ required: false
+ type: string
+ responses:
+ 200:
+ description: Deleted Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
/release/{id}/history:
parameters:
- name: id
@@ -822,6 +978,16 @@ paths:
post:
operationId: "create_work_batch"
parameters:
+ - name: autoaccept
+ in: query
+ type: boolean
+ required: false
+ description: "If true, and editor is authorized, batch is accepted all at once"
+ - name: editgroup
+ in: query
+ type: string
+ required: false
+ description: "Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)"
- name: entity_list
in: body
required: true
@@ -843,19 +1009,47 @@ paths:
in: path
type: string
required: true
- - name: expand
- in: query
- type: string
- required: false
- description: "List of sub-entities to expand in response. For now, only 'all' accepted."
get:
operationId: "get_work"
+ parameters:
+ - name: expand
+ in: query
+ type: string
+ required: false
+ description: "List of sub-entities to expand in response. For now, only 'all' accepted."
responses:
200:
description: Found Entity
schema:
$ref: "#/definitions/work_entity"
<<: *ENTITYRESPONSES
+ put:
+ operationId: "update_work"
+ parameters:
+ - name: entity
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/work_entity"
+ responses:
+ 200:
+ description: Updated Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ delete:
+ operationId: "delete_work"
+ parameters:
+ - name: editgroup
+ in: query
+ required: false
+ type: string
+ responses:
+ 200:
+ description: Deleted Entity
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
/work/{id}/history:
parameters:
- name: id
@@ -1001,10 +1195,18 @@ paths:
description: Unmergable
schema:
$ref: "#/definitions/error_response"
+ 400:
+ description: Bad Request
+ schema:
+ $ref: "#/definitions/error_response"
404:
description: Not Found
schema:
$ref: "#/definitions/error_response"
+ 409:
+ description: Edit Conflict
+ schema:
+ $ref: "#/definitions/error_response"
500:
description: Generic Error
schema: