Skip to content

Commit

Permalink
Studio Update (put)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmetzner committed Aug 30, 2024
1 parent 8cbf103 commit ed0c874
Showing 1 changed file with 58 additions and 5 deletions.
63 changes: 58 additions & 5 deletions catroweb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ paths:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/StudioUpdateRequest'
$ref: '#/components/schemas/CreateStudioRequest'
responses:
'201':
description: Studio successfully created.
Expand Down Expand Up @@ -1333,9 +1333,9 @@ paths:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/StudioUpdateRequest'
$ref: '#/components/schemas/UpdateStudioRequest'
responses:
'201':
'200':
description: Studio successfully updated.
headers:
Location:
Expand All @@ -1352,14 +1352,18 @@ paths:
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'406':
$ref: '#/components/responses/NotAcceptable'
'422':
description: 'Unprocessable Entity (Specific error messages will be translated to the locale)'
content:
application/json:
schema:
$ref: '#/components/schemas/CreateStudioErrorResponse'
$ref: '#/components/schemas/UpdateStudioErrorResponse'
headers:
X-Response-Hash:
$ref: '#/components/headers/X-Response-Hash'
Expand Down Expand Up @@ -2030,6 +2034,28 @@ components:
- "Image type not supported"
- "Image invalid"

UpdateStudioErrorResponse:
type: object
properties:
name:
type: string
enum:
- "Name already in use"
- "Name too short"
- "Name too long"
description:
type: string
enum:
- "Description too short"
- "Description too long"
- "Description missing"
image_file:
type: string
enum:
- "Image size too large"
- "Image type not supported"
- "Image invalid"

######################################################
# Project Schemas
###
Expand Down Expand Up @@ -2413,7 +2439,7 @@ components:
description: ID of the studio
example: 1234abcd-12ab-12ab-12ab-123456abcdef

StudioUpdateRequest:
CreateStudioRequest:
type: object
properties:
name:
Expand Down Expand Up @@ -2442,6 +2468,33 @@ components:
example: panda.png
description: Cover image; Size limit 1MB; Supported extensions are jpeg, png, webp;

UpdateStudioRequest:
type: object
properties:
name:
type: string
example: Panda Gang
description: 'The name of the studio (character: min 3, max 180)'
# no min/max specification in order to handle the errors in catroweb instead of the autogenerated controllers.
description:
type: string
example: The giant panda also known as the panda bear (or simply the panda), is a bear.
description: 'A small description about the Studio (character: min 1, max 3000)'
# no min/max specification in order to handle the errors in catroweb instead of the autogenerated controllers.
is_public:
type: boolean
example: true
description: This flag sets the studios' visibility to public or private
enable_comments:
type: boolean
example: true
description: This flag enables or disabled the possibility to add comments to the studio
image_file:
type: string
format: binary
example: panda.png
description: Cover image; Size limit 1MB; Supported extensions are jpeg, png, webp;

StudioResponse:
type: object
properties:
Expand Down

0 comments on commit ed0c874

Please sign in to comment.