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 (-17 / +192 lines)
Lines 1-23 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
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
12
        in: query
13
        description: Only return the users' lists
14
        required: false
15
        type: string
16
      - name: only_public
17
        in: query
18
        description: Only return public lists
19
        required: false
20
        type: string
21
      - $ref: "../swagger.yaml#/parameters/match"
16
      - $ref: "../swagger.yaml#/parameters/match"
22
      - $ref: "../swagger.yaml#/parameters/order_by"
17
      - $ref: "../swagger.yaml#/parameters/order_by"
23
      - $ref: "../swagger.yaml#/parameters/page"
18
      - $ref: "../swagger.yaml#/parameters/page"
Lines 25-32 Link Here
25
      - $ref: "../swagger.yaml#/parameters/q_param"
20
      - $ref: "../swagger.yaml#/parameters/q_param"
26
      - $ref: "../swagger.yaml#/parameters/q_body"
21
      - $ref: "../swagger.yaml#/parameters/q_body"
27
      - $ref: "../swagger.yaml#/parameters/request_id_header"
22
      - $ref: "../swagger.yaml#/parameters/request_id_header"
28
    produces:
29
      - application/json
30
    responses:
23
    responses:
31
      "200":
24
      "200":
32
        description: A list of lists
25
        description: A list of lists
Lines 40-46 Link Here
40
33
41
            * `bad_request`
34
            * `bad_request`
42
            * `invalid_query`
35
            * `invalid_query`
43
            * `only_mine_forbidden`
44
        schema:
36
        schema:
45
          $ref: "../swagger.yaml#/definitions/error"
37
          $ref: "../swagger.yaml#/definitions/error"
46
      "403":
38
      "403":
Lines 58-60 Link Here
58
        description: Under maintenance
50
        description: Under maintenance
59
        schema:
51
        schema:
60
          $ref: "../swagger.yaml#/definitions/error"
52
          $ref: "../swagger.yaml#/definitions/error"
53
54
55
  post:
56
    x-mojo-to: Lists#create
57
    x-koha-authorization:
58
      permissions:
59
        tools: manage_patron_lists
60
    operationId: createList
61
    tags:
62
      - lists
63
    description: "This resource creates a bibliographic list owned by a specified user."
64
    summary: Create a new list
65
    produces:
66
      - application/json
67
    parameters:
68
      - name: body
69
        in: body
70
        description: A JSON object containing information about the new list
71
        required: true
72
        schema:
73
          $ref: "../swagger.yaml#/definitions/list"
74
    responses:
75
      "201":
76
        description: List added
77
        schema:
78
          $ref: "../swagger.yaml#/definitions/list"
79
      "400":
80
        description: Bad request
81
        schema:
82
          $ref: "../swagger.yaml#/definitions/error"
83
      "401":
84
        description: Authentication required
85
        schema:
86
          $ref: "../swagger.yaml#/definitions/error"
87
      "403":
88
        description: Access forbidden
89
        schema:
90
          $ref: "../swagger.yaml#/definitions/error"
91
      "500":
92
        description: |
93
          Internal server error. Possible `error_code` attribute values:
94
95
          * `internal_server_error`
96
        schema:
97
          $ref: "../swagger.yaml#/definitions/error"
98
      "503":
99
        description: Under maintenance
100
        schema:
101
          $ref: "../swagger.yaml#/definitions/error"
102
103
/lists/{list_id}:
104
  get:
105
    x-mojo-to: Lists#read
106
    x-koha-authorization:
107
      permissions:
108
        tools: manage_patron_lists
109
    description: "This resource returns information on a specific existing bibliographic list."
110
    operationId: readList
111
    tags:
112
      - lists
113
    summary: Retrieve a specific list
114
    produces:
115
      - application/json
116
    parameters:
117
      - $ref: "../swagger.yaml#/parameters/list_id_pp"
118
    responses:
119
      "200":
120
        description: OK
121
        schema:
122
          $ref: "../swagger.yaml#/definitions/list"
123
      "400":
124
        description: Bad request
125
        schema:
126
          $ref: "../swagger.yaml#/definitions/error"
127
      "403":
128
        description: Access forbidden
129
        schema:
130
          $ref: "../swagger.yaml#/definitions/error"
131
      "404":
132
        description: Not found
133
        schema:
134
          $ref: "../swagger.yaml#/definitions/error"
135
      "500":
136
        description: |
137
          Internal server error. Possible `error_code` attribute values:
138
139
          * `internal_server_error`
140
        schema:
141
          $ref: "../swagger.yaml#/definitions/error"
142
      "503":
143
        description: Under maintenance
144
        schema:
145
          $ref: "../swagger.yaml#/definitions/error"
146
147
  put:
148
    x-mojo-to: Lists#update
149
    x-koha-authorization:
150
      permissions:
151
        tools: manage_patron_lists
152
    operationId: updateList
153
    description: 'Update a specific list'
154
    tags:
155
      - lists
156
    summary: Update a specific list
157
    produces:
158
      - application/json
159
    parameters:
160
      - $ref: "../swagger.yaml#/parameters/list_id_pp"
161
      - name: body
162
        in: body
163
        description: A list object
164
        required: true
165
        schema:
166
          $ref: "../swagger.yaml#/definitions/list"
167
    responses:
168
      "200":
169
        description: A city
170
        schema:
171
          $ref: "../swagger.yaml#/definitions/list"
172
      "400":
173
        description: Bad request
174
        schema:
175
          $ref: "../swagger.yaml#/definitions/error"
176
      "401":
177
        description: Authentication required
178
        schema:
179
          $ref: "../swagger.yaml#/definitions/error"
180
      "403":
181
        description: Access forbidden
182
        schema:
183
          $ref: "../swagger.yaml#/definitions/error"
184
      "404":
185
        description: Not found
186
        schema:
187
          $ref: "../swagger.yaml#/definitions/error"
188
      "500":
189
        description: |
190
          Internal server error. Possible `error_code` attribute values:
191
192
          * `internal_server_error`
193
        schema:
194
          $ref: "../swagger.yaml#/definitions/error"
195
      "503":
196
        description: Under maintenance
197
        schema:
198
          $ref: "../swagger.yaml#/definitions/error"
199
200
  delete:
201
    x-mojo-to: Lists#delete
202
    x-koha-authorization:
203
      permissions:
204
        tools: manage_patron_lists
205
    operationId: deleteList
206
    tags:
207
      - lists
208
    summary: Delete a specific list
209
    produces:
210
      - application/json
211
    parameters:
212
      - $ref: "../swagger.yaml#/parameters/list_id_pp"
213
    responses:
214
      "204":
215
        description: List deleted
216
      "401":
217
        description: Authentication required
218
        schema:
219
          $ref: "../swagger.yaml#/definitions/error"
220
      "403":
221
        description: Access forbidden
222
        schema:
223
          $ref: "../swagger.yaml#/definitions/error"
224
      "404":
225
        description: List not found
226
        schema:
227
          $ref: "../swagger.yaml#/definitions/error"
228
      "500":
229
        description: Internal error
230
        schema:
231
          $ref: "../swagger.yaml#/definitions/error"
232
      "503":
233
        description: Under maintenance
234
        schema:
235
          $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