-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmaterial-list-1.0.0.yaml
170 lines (165 loc) · 5 KB
/
material-list-1.0.0.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
openapi: 3.0.0
info:
version: '1.0.0'
title: 'Material list'
license:
name: 'GNU General Public License v3.0'
url: 'https://www.gnu.org/licenses/gpl-3.0.html'
servers:
- url: https://prod.materiallist.dandigbib.org
description: Production server (uses live data)
- url: https://test.materiallist.dandigbib.org
description: Test server (uses test data)
tags:
- name: 'List'
description: List handling
- name: 'Migrate'
description: Data migration
security:
- BearerAuth: []
paths:
/list/{listId}:
get:
operationId: getList
tags:
- List
description: 'Get list with materials.'
parameters:
- $ref: '#/components/parameters/listId'
- $ref: '#/components/parameters/materialIds'
responses:
200:
description: 'The list data is returned.'
content:
application/json:
schema:
$ref: '#/components/schemas/List'
404:
description: 'Unknown list.'
default:
description: 'Unspecified error.'
/list/{listId}/{materialId}:
head:
operationId: checkListMaterial
tags:
- List
description: 'Check existence of material on list. To check multiple materials in one request, see the material_ids query parameter on /list/{listId}.'
parameters:
- $ref: '#/components/parameters/listId'
- $ref: '#/components/parameters/materialId'
responses:
200:
description: 'The material exists on the list.'
404:
description: 'The list or material does not exist.'
default:
description: 'Unspecified error.'
put:
operationId: addListMaterial
tags:
- List
description: 'Add material to the the list.'
parameters:
- $ref: '#/components/parameters/listId'
- $ref: '#/components/parameters/materialId'
responses:
201:
description: 'The material was successfully added to the list.'
404:
description: 'Unknown list.'
default:
description: 'Unspecified error.'
delete:
operationId: deleteListMaterial
tags:
- List
description: 'Delete material from list.'
parameters:
- $ref: '#/components/parameters/listId'
- $ref: '#/components/parameters/materialId'
responses:
204:
description: 'Successfully removed.'
404:
description: 'Unknown list or material.'
default:
description: 'Unspecified error.'
/migrate/{legacyUserId}:
put:
operationId: migrateList
tags:
- Migrate
description: 'Migrate list for the legacy user identifier to current user.'
parameters:
- $ref: '#/components/parameters/legacyUserId'
responses:
204:
description: 'Successfully migrated.'
default:
description: 'Unspecified error.'
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
parameters:
listId:
name: 'listId'
in: 'path'
description: 'The identifier of the list to return. Use "default" for the default list.'
required: true
example: 'default'
schema:
$ref: '#/components/schemas/ListId'
materialId:
name: 'materialId'
in: 'path'
description: 'The identifier of the material.'
required: true
example: '870970-basis:54871910'
schema:
$ref: '#/components/schemas/MaterialId'
materialIds:
name: 'material_ids'
in: 'query'
description: 'Filter the list reply down to the given material identifiers. This is the recommended way to check for existence of multiple materials on the list.'
example:
- 870970-basis:54871910
- 870970-basis:44791668
explode: false
schema:
type: array
items:
$ref: '#/components/schemas/MaterialId'
legacyUserId:
name: 'legacyUserId'
in: 'path'
description: 'Legacy user identifier of a migrated list.'
required: true
example: '29A10F616FE6CA5C6E06EBF507A9FDC5BB89F8EBCF65726BEAC61C646854E83856D3B1D46BE4696EDCFB3C9F57EEBB6941D8654BC1F4B514D6217141AEA1653C'
schema:
$ref: '#/components/schemas/LegacyUserId'
schemas:
ListId:
description: 'List identifier. In the initial version, this can only be "default".'
type: string
MaterialId:
description: 'A material identifier in the form of a PID.'
type: string
List:
type: object
required:
- id
- materials
additionalProperties: false
properties:
id:
$ref: '#/components/schemas/ListId'
materials:
type: array
items:
$ref: '#/components/schemas/MaterialId'
LegacyUserId:
description: 'Legacy user identifier.'
type: string
example: '29A10F616FE6CA5C6E06EBF507A9FDC5BB89F8EBCF65726BEAC61C646854E83856D3B1D46BE4696EDCFB3C9F57EEBB6941D8654BC1F4B514D6217141AEA1653C'