View | Details | Raw Unified | Return to bug 38050
Collapse All | Expand All

(-)a/api/v1/swagger/definitions/list.yaml (-1 / +16 lines)
Lines 2-9 Link Here
2
type: object
2
type: object
3
properties:
3
properties:
4
    list_id:
4
    list_id:
5
        description: Interal identifier for the list
5
        description: Internal identifier for the list
6
        type: integer
6
        type: integer
7
        readOnly: true
7
    name:
8
    name:
8
        description: List name
9
        description: List name
9
        type: string
10
        type: string
Lines 11-35 properties: Link Here
11
        description: Date the list was created
12
        description: Date the list was created
12
        type: string
13
        type: string
13
        format: date-time
14
        format: date-time
15
        readOnly: true
14
    updated_on_date:
16
    updated_on_date:
15
        description: Date the list was last updated
17
        description: Date the list was last updated
16
        type: string
18
        type: string
17
        format: date-time
19
        format: date-time
20
        readOnly: true
18
    owner_id:
21
    owner_id:
19
        description: Internal identifier for the owning patron
22
        description: Internal identifier for the owning patron
20
        type: integer
23
        type: integer
21
    allow_change_from_owner:
24
    allow_change_from_owner:
22
        description: If the owner can change the contents
25
        description: If the owner can change the contents
23
        type: boolean
26
        type: boolean
27
        default: true
24
    allow_change_from_others:
28
    allow_change_from_others:
25
        description: If others can change the contents
29
        description: If others can change the contents
26
        type: boolean
30
        type: boolean
31
        default: false
27
    public:
32
    public:
28
        description: If the list is public
33
        description: If the list is public
29
        type: boolean
34
        type: boolean
35
        default: true
30
    default_sort_field:
36
    default_sort_field:
31
        description: The field this list is sorted on by default
37
        description: The field this list is sorted on by default
32
        type: string
38
        type: string
39
        default: 'title'
40
    allow_change_from_permitted_staff:
41
        description: If only permitted staff can change the contents
42
        type: boolean
43
        default: false
44
    allow_change_from_staff:
45
        description: If staff can change the contents
46
        type: boolean
47
        default: false
33
additionalProperties: false
48
additionalProperties: false
34
required:
49
required:
35
    - list_id
50
    - list_id
(-)a/api/v1/swagger/paths/lists.yaml (-6 / +191 lines)
Lines 1-12 Link Here
1
---
1
---
2
"/public/lists":
2
/lists:
3
  get:
3
  get:
4
    x-mojo-to: Lists#list_public
4
    x-mojo-to: Lists#list_public
5
    operationId: listListsPublic
6
    description: "This resource returns a list of existing bibliographic lists."
5
    description: "This resource returns a list of existing bibliographic lists."
7
    summary: List bibliographic lists
6
    x-koha-authorization:
7
      permissions:
8
        tools: manage_patron_lists
9
    operationId: listLists
8
    tags:
10
    tags:
9
      - lists
11
      - lists
12
    summary: List bibliographic lists
13
    produces:
14
      - application/json
10
    parameters:
15
    parameters:
11
      - name: only_mine
16
      - name: only_mine
12
        in: query
17
        in: query
Lines 25-32 Link Here
25
      - $ref: "../swagger.yaml#/parameters/q_param"
30
      - $ref: "../swagger.yaml#/parameters/q_param"
26
      - $ref: "../swagger.yaml#/parameters/q_body"
31
      - $ref: "../swagger.yaml#/parameters/q_body"
27
      - $ref: "../swagger.yaml#/parameters/request_id_header"
32
      - $ref: "../swagger.yaml#/parameters/request_id_header"
28
    produces:
29
      - application/json
30
    responses:
33
    responses:
31
      "200":
34
      "200":
32
        description: A list of lists
35
        description: A list of lists
Lines 40-46 Link Here
40
43
41
            * `bad_request`
44
            * `bad_request`
42
            * `invalid_query`
45
            * `invalid_query`
43
            * `only_mine_forbidden`
44
        schema:
46
        schema:
45
          $ref: "../swagger.yaml#/definitions/error"
47
          $ref: "../swagger.yaml#/definitions/error"
46
      "403":
48
      "403":
Lines 58-60 Link Here
58
        description: Under maintenance
60
        description: Under maintenance
59
        schema:
61
        schema:
60
          $ref: "../swagger.yaml#/definitions/error"
62
          $ref: "../swagger.yaml#/definitions/error"
63
64
65
  post:
66
    x-mojo-to: Lists#add
67
    x-koha-authorization:
68
      permissions:
69
        tools: manage_patron_lists
70
    operationId: createList
71
    tags:
72
      - lists
73
    description: "This resource creates a bibliographic list owned by a specified user."
74
    summary: Create a new list
75
    produces:
76
      - application/json
77
    parameters:
78
      - name: body
79
        in: body
80
        description: A JSON object containing information about the new list
81
        required: true
82
        schema:
83
          $ref: "../swagger.yaml#/definitions/list"
84
    responses:
85
      "201":
86
        description: List added
87
        schema:
88
          $ref: "../swagger.yaml#/definitions/list"
89
      "400":
90
        description: Bad request
91
        schema:
92
          $ref: "../swagger.yaml#/definitions/error"
93
      "401":
94
        description: Authentication required
95
        schema:
96
          $ref: "../swagger.yaml#/definitions/error"
97
      "403":
98
        description: Access forbidden
99
        schema:
100
          $ref: "../swagger.yaml#/definitions/error"
101
      "500":
102
        description: |
103
          Internal server error. Possible `error_code` attribute values:
104
105
          * `internal_server_error`
106
        schema:
107
          $ref: "../swagger.yaml#/definitions/error"
108
      "503":
109
        description: Under maintenance
110
        schema:
111
          $ref: "../swagger.yaml#/definitions/error"
112
113
/lists/{list_id}:
114
  get:
115
    x-mojo-to: Lists#public_get
116
    x-koha-authorization:
117
      permissions:
118
        tools: manage_patron_lists
119
    description: "This resource returns information on a specific existing bibliographic list."
120
    operationId: readList
121
    tags:
122
      - lists
123
    summary: Retrieve a specific list
124
    produces:
125
      - application/json
126
    parameters:
127
      - $ref: "../swagger.yaml#/parameters/list_id_pp"
128
    responses:
129
      "200":
130
        description: OK
131
        schema:
132
          $ref: "../swagger.yaml#/definitions/list"
133
      "400":
134
        description: Bad request
135
        schema:
136
          $ref: "../swagger.yaml#/definitions/error"
137
      "403":
138
        description: Access forbidden
139
        schema:
140
          $ref: "../swagger.yaml#/definitions/error"
141
      "404":
142
        description: Not found
143
        schema:
144
          $ref: "../swagger.yaml#/definitions/error"
145
      "500":
146
        description: |
147
          Internal server error. Possible `error_code` attribute values:
148
149
          * `internal_server_error`
150
        schema:
151
          $ref: "../swagger.yaml#/definitions/error"
152
      "503":
153
        description: Under maintenance
154
        schema:
155
          $ref: "../swagger.yaml#/definitions/error"
156
157
  put:
158
    x-mojo-to: Lists#update
159
    x-koha-authorization:
160
      permissions:
161
        tools: manage_patron_lists
162
    operationId: updateList
163
    description: 'Update a specific list'
164
    tags:
165
      - lists
166
    summary: Update a specific list
167
    produces:
168
      - application/json
169
    parameters:
170
      - $ref: "../swagger.yaml#/parameters/list_id_pp"
171
      - name: body
172
        in: body
173
        description: A list object
174
        required: true
175
        schema:
176
          $ref: "../swagger.yaml#/definitions/list"
177
    responses:
178
      "200":
179
        description: A city
180
        schema:
181
          $ref: "../swagger.yaml#/definitions/list"
182
      "400":
183
        description: Bad request
184
        schema:
185
          $ref: "../swagger.yaml#/definitions/error"
186
      "401":
187
        description: Authentication required
188
        schema:
189
          $ref: "../swagger.yaml#/definitions/error"
190
      "403":
191
        description: Access forbidden
192
        schema:
193
          $ref: "../swagger.yaml#/definitions/error"
194
      "404":
195
        description: Not found
196
        schema:
197
          $ref: "../swagger.yaml#/definitions/error"
198
      "500":
199
        description: |
200
          Internal server error. Possible `error_code` attribute values:
201
202
          * `internal_server_error`
203
        schema:
204
          $ref: "../swagger.yaml#/definitions/error"
205
      "503":
206
        description: Under maintenance
207
        schema:
208
          $ref: "../swagger.yaml#/definitions/error"
209
210
  delete:
211
    x-mojo-to: Lists#delete
212
    x-koha-authorization:
213
      permissions:
214
        tools: manage_patron_lists
215
    operationId: deleteList
216
    tags:
217
      - lists
218
    summary: Delete a specific list
219
    produces:
220
      - application/json
221
    parameters:
222
      - $ref: "../swagger.yaml#/parameters/list_id_pp"
223
    responses:
224
      "204":
225
        description: List deleted
226
      "401":
227
        description: Authentication required
228
        schema:
229
          $ref: "../swagger.yaml#/definitions/error"
230
      "403":
231
        description: Access forbidden
232
        schema:
233
          $ref: "../swagger.yaml#/definitions/error"
234
      "404":
235
        description: List not found
236
        schema:
237
          $ref: "../swagger.yaml#/definitions/error"
238
      "500":
239
        description: Internal error
240
        schema:
241
          $ref: "../swagger.yaml#/definitions/error"
242
      "503":
243
        description: Under maintenance
244
        schema:
245
          $ref: "../swagger.yaml#/definitions/error"
(-)a/api/v1/swagger/swagger.yaml (-1 / +10 lines)
Lines 445-450 paths: Link Here
445
    $ref: "./paths/libraries.yaml#/~1libraries~1{library_id}~1cash_registers"
445
    $ref: "./paths/libraries.yaml#/~1libraries~1{library_id}~1cash_registers"
446
  "/libraries/{library_id}/desks":
446
  "/libraries/{library_id}/desks":
447
    $ref: "./paths/libraries.yaml#/~1libraries~1{library_id}~1desks"
447
    $ref: "./paths/libraries.yaml#/~1libraries~1{library_id}~1desks"
448
  /lists:
449
    $ref: ./paths/lists.yaml#/~1lists
450
  "/lists/{id}":
451
    $ref: "./paths/lists.yaml#/~1lists~1{id}"
448
  "/oauth/login/{provider_code}/{interface}":
452
  "/oauth/login/{provider_code}/{interface}":
449
    $ref: ./paths/oauth.yaml#/~1oauth~1login~1{provider_code}~1{interface}
453
    $ref: ./paths/oauth.yaml#/~1oauth~1login~1{provider_code}~1{interface}
450
  /oauth/token:
454
  /oauth/token:
Lines 806-811 parameters: Link Here
806
    name: license_id
810
    name: license_id
807
    required: true
811
    required: true
808
    type: integer
812
    type: integer
813
  list_id_pp:
814
    description: list internal identifier
815
    in: path
816
    name: list_id
817
    required: true
818
    type: integer
809
  match:
819
  match:
810
    description: Matching criteria
820
    description: Matching criteria
811
    enum:
821
    enum:
812
- 

Return to bug 38050