aboutsummaryrefslogtreecommitdiffstats
path: root/golang/fatcat-openapi2.yml
blob: 85d3b4fcdfbec967ab6a8207850c22ebfcde383d (plain)
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
---
swagger: "2.0"
info:
  title: fatcat
  description: A scalable, versioned, API-oriented catalog of bibliographic entities
    and file metadata
  version: 0.1.0
schemes: [http]
basePath: /v0
host: api.fatcat.wiki
consumes:
- application/json
produces:
- application/json

# TODO: try to make this work:
#x-entity-props: &ENTITYPROPS
#<<: *ENTITYPROPS


definitions:
  error:
    type: object
    required:
      - message
    properties:
      message:
        type: string
  creator_entity:
    type: object
    required:
      - ident
      - state
    properties:
      state: 
        type: string
        # actually enum of: (wip, active, redirect, deleted)
      ident:
        type: string
        # format: uuid
      revision:
        type: string
        # integer
      redirect:
        type: string
        # format: uuid
      name:
        type: string
      orcid:
        type: string
        # format: custom

paths:
  /creator:
    post:
      parameters:
        - name: body
          in: body
          schema:
            $ref: "#/definitions/creator_entity"
      responses:
        201:
          description: created
          schema:
            $ref: "#/definitions/creator_entity"
        default:
          description: generic error response
          schema:
            $ref: "#/definitions/error"
  /creator/{id}:
    parameters:
      - name: id
        in: path
        type: string
        required: true
    get:
      responses:
        200:
          description: fetch a single creator by id
          schema:
            $ref: "#/definitions/creator_entity"
        default:
          description: generic error response
          schema:
            $ref: "#/definitions/error"
# /creator/lookup:

# /editgroup:
# /editgroup/{id}:
# /editgroup/{id}/accept:

# /editor/{username}:
# /editor/{username}/changelog: