Skip to content

Commit 40fb4cd

Browse files
norrisng-bcTimCsaky
authored andcommitted
OpenAPI spec: use code blocks for permCodes and params in description
1 parent 8c92cd1 commit 40fb4cd

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

app/src/docs/v1.api-spec.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ paths:
199199
summary: Deletes a bucket
200200
description: >-
201201
Deletes the bucket record (and child objects) from the COMS database, based on bucketId.
202-
When calling this endpoint using OIDC token authentication, the user requires the DELETE
202+
When calling this endpoint using OIDC token authentication, the user requires the `DELETE`
203203
permission for the bucket.
204-
Providing the 'recursive' parameter will also delete all sub-folders.
205-
The recursive option also requires the OIDC user to have the DELETE permission
204+
Providing the `recursive` parameter will also delete all sub-folders.
205+
The `recursive` option also requires the OIDC user to have the `DELETE` permission
206206
on all of these sub-folders otherwise the entire operation will fail.
207207
This request does not dispatch an S3 operation to request the deletion of the associated
208208
bucket(s) or delete any objects in object storage, it simply 'de-registers' knowledge of the bucket/folder
@@ -2588,6 +2588,11 @@ components:
25882588
`objectId` must be specified.
25892589
format: uuid
25902590
example: ac246e31-c807-496c-bc93-cd8bc2f1b2b4
2591+
recursive:
2592+
type: boolean
2593+
description: >-
2594+
Optionally apply permCodes to all sub-folders in the spcified bucket
2595+
example: true
25912596
email:
25922597
type: string
25932598
description: >-
@@ -2614,7 +2619,7 @@ components:
26142619
type: array
26152620
items:
26162621
type: string
2617-
description: Optional array of permCode. Defaults to 'READ', if unspecified. Accepts any of `"READ", "CREATE", "UPDATE"` for bucket or `"READ", "UPDATE"` for objects
2622+
description: Optional array of permCode. Defaults to `READ`, if unspecified. Accepts any of `"READ", "CREATE", "UPDATE"` for bucket or `"READ", "UPDATE"` for objects
26182623
example: ["READ", "CREATE", "UPDATE"]
26192624
Request-UpdateBucket:
26202625
title: Request Update Bucket

app/tests/unit/controllers/invite.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('createInvite', () => {
9797
});
9898

9999
describe('object', () => {
100-
it('should 409 when object not found', async () => {
100+
it('should 404 when object not found', async () => {
101101
const req = { body: { objectId: RESOURCE } };
102102

103103
objectReadSpy.mockRejectedValue({ statusCode: 404 });
@@ -111,7 +111,7 @@ describe('createInvite', () => {
111111
expect(objectReadSpy).toHaveBeenCalledWith(RESOURCE);
112112
expect(objectSearchPermissionSpy).toHaveBeenCalledTimes(0);
113113
expect(next).toHaveBeenCalledTimes(1);
114-
expect(next).toHaveBeenCalledWith(new Problem(409));
114+
expect(next).toHaveBeenCalledWith(new Problem(404));
115115
});
116116

117117
it('should 403 when no object manage permission found', async () => {
@@ -261,7 +261,7 @@ describe('createInvite', () => {
261261
});
262262

263263
describe('bucket', () => {
264-
it('should 409 when bucket not found', async () => {
264+
it('should 404 when bucket not found', async () => {
265265
const req = { body: { bucketId: RESOURCE } };
266266

267267
bucketReadSpy.mockRejectedValue({ statusCode: 404 });
@@ -275,7 +275,7 @@ describe('createInvite', () => {
275275
expect(objectReadSpy).toHaveBeenCalledTimes(0);
276276
expect(objectSearchPermissionSpy).toHaveBeenCalledTimes(0);
277277
expect(next).toHaveBeenCalledTimes(1);
278-
expect(next).toHaveBeenCalledWith(new Problem(409));
278+
expect(next).toHaveBeenCalledWith(new Problem(404));
279279
});
280280

281281
it('should 403 when no bucket manage permission found', async () => {

0 commit comments

Comments
 (0)