aboutsummaryrefslogtreecommitdiffstats
path: root/golang/fatcat-openapi2.yml
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-10 19:56:41 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-10 19:56:41 -0700
commit71c6b0a4418511a6c0046742512066fc27e51b21 (patch)
treefd6e6ac97df646f2d72a83fe5148eb40f38a9cd2 /golang/fatcat-openapi2.yml
parent353de263272d41f6d7c1becb481f787966a1aa4c (diff)
downloadfatcat-71c6b0a4418511a6c0046742512066fc27e51b21.tar.gz
fatcat-71c6b0a4418511a6c0046742512066fc27e51b21.zip
cleanup openapi schema
Diffstat (limited to 'golang/fatcat-openapi2.yml')
-rw-r--r--golang/fatcat-openapi2.yml58
1 files changed, 35 insertions, 23 deletions
diff --git a/golang/fatcat-openapi2.yml b/golang/fatcat-openapi2.yml
index a00780f0..5d22213f 100644
--- a/golang/fatcat-openapi2.yml
+++ b/golang/fatcat-openapi2.yml
@@ -9,13 +9,23 @@ schemes: [http]
basePath: /v0
host: api.fatcat.wiki
consumes:
-- application/json
+ - application/json
produces:
-- application/json
+ - application/json
-# TODO: try to make this work:
-#x-entity-props: &ENTITYPROPS
-#<<: *ENTITYPROPS
+# Common properties across entities
+x-entity-props: &ENTITYPROPS
+ state:
+ type: string
+ enum: ["wip", "active", "redirect", "deleted"]
+ ident:
+ type: string
+ #format: uuid
+ revision:
+ type: integer
+ redirect:
+ type: string
+ #format: uuid
definitions:
@@ -33,35 +43,37 @@ definitions:
properties:
message:
type: string
- creator_entity:
+ release_entity:
type: object
required:
- ident
- state
- - name
properties:
- state:
- type: string
- enum: ["wip", "active", "redirect", "deleted"]
- ident:
+ <<: *ENTITYPROPS
+ name:
type: string
- #format: uuid
- revision:
- type: integer
- redirect:
+ orcid:
type: string
- # format: uuid
+ #format: custom
+ creator_entity:
+ type: object
+ required:
+ - ident
+ - state
+ - name
+ properties:
+ <<: *ENTITYPROPS
name:
type: string
orcid:
type: string
- # format: custom
+ #format: custom
editor:
type: object
required:
- username
properties:
- username:
+ username:
type: string
editgroup:
type: object
@@ -69,20 +81,20 @@ definitions:
- id
- editor_id
properties:
- id:
+ id:
type: integer
- editor_id:
+ editor_id:
type: integer
changelogentry:
type: object
required:
- index
properties:
- index:
+ index:
type: integer
- editgroup_id:
+ editgroup_id:
type: integer
- timestamp:
+ timestamp:
type: string
format: date-time