summaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
Diffstat (limited to 'rust')
-rw-r--r--rust/fatcat-openapi2.yml244
1 files changed, 218 insertions, 26 deletions
diff --git a/rust/fatcat-openapi2.yml b/rust/fatcat-openapi2.yml
index 6d6350ea..badb17ab 100644
--- a/rust/fatcat-openapi2.yml
+++ b/rust/fatcat-openapi2.yml
@@ -13,6 +13,7 @@ consumes:
produces:
- application/json
+
# Common properties across entities
x-entity-props: &ENTITYPROPS
state:
@@ -26,6 +27,8 @@ x-entity-props: &ENTITYPROPS
redirect:
type: string
#format: uuid
+ editgroup:
+ type: integer
x-entity-edit-props: &ENTITYEDITPROPS
id:
type: integer
@@ -52,11 +55,8 @@ definitions:
properties:
message:
type: string
- release_entity:
+ creator_entity:
type: object
- required:
- - ident
- - state
properties:
<<: *ENTITYPROPS
name:
@@ -64,15 +64,62 @@ definitions:
orcid:
type: string
#format: custom
- creator_entity:
+ container_entity:
type: object
properties:
<<: *ENTITYPROPS
name:
type: string
- orcid:
+ parent:
+ type: string
+ publisher:
+ type: string
+ issn:
+ type: string
+ #format: custom
+ file_entity:
+ type: object
+ properties:
+ <<: *ENTITYPROPS
+ size:
+ type: integer
+ sha1:
+ type: string
+ #format: custom
+ url:
+ type: string
+ format: url
+ release_entity:
+ type: object
+ properties:
+ <<: *ENTITYPROPS
+ work:
+ type: string
+ container:
+ type: string
+ license:
+ type: string
+ release_type:
+ type: string
+ date:
+ type: date
+ doi:
type: string
#format: custom
+ volume:
+ type: string
+ pages:
+ type: string
+ issue:
+ type: string
+ work_entity:
+ type: object
+ properties:
+ <<: *ENTITYPROPS
+ title:
+ type: string
+ work_type:
+ type: string
entity_edit:
type: object
properties:
@@ -107,6 +154,16 @@ definitions:
type: string
format: date-time
+x-entity-responses: &ENTITYRESPONSES
+ 400:
+ description: bad request
+ schema:
+ $ref: "#/definitions/error"
+ default:
+ description: generic error response
+ schema:
+ $ref: "#/definitions/error"
+
paths:
/creator:
post:
@@ -115,22 +172,12 @@ paths:
in: body
schema:
$ref: "#/definitions/creator_entity"
- #- name: editgroup
- # in: body
- # type: string
responses:
201:
description: created
schema:
$ref: "#/definitions/entity_edit"
- 400:
- description: bad request
- schema:
- $ref: "#/definitions/error"
- default:
- description: generic error response
- schema:
- $ref: "#/definitions/error"
+ <<: *ENTITYRESPONSES
/creator/{id}:
parameters:
- name: id
@@ -143,34 +190,179 @@ paths:
description: fetch a single creator by id
schema:
$ref: "#/definitions/creator_entity"
+ <<: *ENTITYRESPONSES
+ /creator/lookup:
+ get:
+ parameters:
+ - name: orcid
+ in: query
+ type: string
+ required: true
+ responses:
+ 200:
+ description: find a single creator by external identifer
+ schema:
+ $ref: "#/definitions/creator_entity"
404:
description: no such creator
schema:
$ref: "#/definitions/error"
- default:
- description: generic error response
+ <<: *ENTITYRESPONSES
+ /container:
+ post:
+ parameters:
+ - name: body
+ in: body
+ schema:
+ $ref: "#/definitions/container_entity"
+ responses:
+ 201:
+ description: created
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ /container/{id}:
+ parameters:
+ - name: id
+ in: path
+ type: string
+ required: true
+ get:
+ responses:
+ 200:
+ description: fetch a single container by id
+ schema:
+ $ref: "#/definitions/container_entity"
+ <<: *ENTITYRESPONSES
+ /container/lookup:
+ get:
+ parameters:
+ - name: issn
+ in: query
+ type: string
+ required: true
+ responses:
+ 200:
+ description: find a single container by external identifer
+ schema:
+ $ref: "#/definitions/container_entity"
+ 404:
+ description: no such container
schema:
$ref: "#/definitions/error"
- /creator/lookup:
+ <<: *ENTITYRESPONSES
+ /file:
+ post:
+ parameters:
+ - name: body
+ in: body
+ schema:
+ $ref: "#/definitions/file_entity"
+ responses:
+ 201:
+ description: created
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ /file/{id}:
+ parameters:
+ - name: id
+ in: path
+ type: string
+ required: true
+ get:
+ responses:
+ 200:
+ description: fetch a single file by id
+ schema:
+ $ref: "#/definitions/file_entity"
+ <<: *ENTITYRESPONSES
+ /file/lookup:
get:
parameters:
- - name: orcid
+ - name: sha1
in: query
type: string
required: true
responses:
200:
- description: find a single creator by external identifer
+ description: find a single file by external identifer
schema:
- $ref: "#/definitions/creator_entity"
+ $ref: "#/definitions/file_entity"
404:
- description: no such creator
+ description: no such file
schema:
$ref: "#/definitions/error"
- default:
- description: generic error response
+ <<: *ENTITYRESPONSES
+ /release:
+ post:
+ parameters:
+ - name: body
+ in: body
+ schema:
+ $ref: "#/definitions/release_entity"
+ responses:
+ 201:
+ description: created
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ /release/{id}:
+ parameters:
+ - name: id
+ in: path
+ type: string
+ required: true
+ get:
+ responses:
+ 200:
+ description: fetch a single release by id
+ schema:
+ $ref: "#/definitions/release_entity"
+ <<: *ENTITYRESPONSES
+ /release/lookup:
+ get:
+ parameters:
+ - name: doi
+ in: query
+ type: string
+ required: true
+ responses:
+ 200:
+ description: find a single release by external identifer
+ schema:
+ $ref: "#/definitions/release_entity"
+ 404:
+ description: no such release
schema:
$ref: "#/definitions/error"
+ <<: *ENTITYRESPONSES
+ /work:
+ post:
+ parameters:
+ - name: body
+ in: body
+ schema:
+ $ref: "#/definitions/work_entity"
+ responses:
+ 201:
+ description: created
+ schema:
+ $ref: "#/definitions/entity_edit"
+ <<: *ENTITYRESPONSES
+ /work/{id}:
+ parameters:
+ - name: id
+ in: path
+ type: string
+ required: true
+ get:
+ responses:
+ 200:
+ description: fetch a single work by id
+ schema:
+ $ref: "#/definitions/work_entity"
+ <<: *ENTITYRESPONSES
/editor/{username}:
parameters:
- name: username