announcement_service_spec.yaml updated, patchnotes_controller.py updated accordingly to changes

This commit is contained in:
2025-05-21 12:55:42 +02:00
parent 5007a434ca
commit 87651e70d4
9 changed files with 586 additions and 329 deletions
+171 -73
View File
@@ -5,11 +5,44 @@ info:
version: 1.0.0
servers:
- url: /
tags:
- description: "Create, update and read patchnotes"
name: Patchnotes
paths:
/patchnotes:
get:
description: returns list of all Patch notes
operationId: patchnotes_get
operationId: list_patchnotes
parameters:
- description: Only patchnotes newer than this date (YYYY-MM-DD)
explode: true
in: query
name: since
required: false
schema:
format: date
type: string
style: form
- description: Maximum number of items to return
explode: true
in: query
name: limit
required: false
schema:
default: 20
maximum: 100
minimum: 1
type: integer
style: form
- description: Pagination offset
explode: true
in: query
name: offset
required: false
schema:
default: 0
minimum: 0
type: integer
style: form
responses:
"200":
content:
@@ -18,86 +51,93 @@ paths:
items:
$ref: '#/components/schemas/patch_notes'
type: array
description: returns list of all unseen Patch notes from the user
description: list of patch notes
"404":
description: no Patch notes found
summary: Returns list of patch notes newer than the caller’s last login
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
post:
description: creates new Patch notes
operationId: patchnotes_post
operationId: create_patchnote
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/patch_notes'
$ref: '#/components/schemas/patch_notes_input'
required: true
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/patch_notes'
description: patch note created
headers:
Location:
description: URL of the newly created patch note
explode: false
schema:
type: string
style: simple
"400":
description: bad payload
summary: Creates new patch notes
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
/patchnotes/{patchID}:
delete:
operationId: delete_patchnote
parameters:
- description: ID of the patch note
explode: false
in: path
name: patchID
required: true
schema:
format: uuid
type: string
style: simple
responses:
"204":
description: patch successfully deleted
"404":
description: patch not found
summary: Deletes one patch note
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
get:
operationId: get_patchnote
parameters:
- description: ID of the patch note
explode: false
in: path
name: patchID
required: true
schema:
format: uuid
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/patch_notes'
description: game created
"400":
description: bad payload
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
/patchnotes/{date}:
get:
description: returns list of all unseen Patch notes from the user
operationId: patchnotes_date_get
parameters:
- example: 2025-01-02
explode: false
in: path
name: date
required: true
schema:
format: date
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
items:
$ref: '#/components/schemas/patch_notes'
type: array
description: returns list of all unseen Patch notes from the user
description: single patch note
"404":
description: no Patch notes found
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
/patchnotes/{patchID}:
delete:
description: deletes one Patch note
operationId: patchnotes_patch_iddelete
parameters:
- explode: false
in: path
name: patchID
required: true
schema:
format: uuid
type: string
style: simple
responses:
"200":
description: patch successfully deleted
"404":
description: patch not found
description: no patch note found
summary: Returns one patch note
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
put:
description: Updates one Patch
operationId: patchnotes_patch_idput
operationId: update_patchnote
parameters:
- explode: false
- description: ID of the patch note
explode: false
in: path
name: patchID
required: true
@@ -109,29 +149,93 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/patch_notes'
$ref: '#/components/schemas/patch_notes_input'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/patch_notes'
description: patch updated
"404":
description: no patch found
description: no patch note found
summary: Updates one patch note (full replace)
tags:
- Patchnotes
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
components:
parameters:
SinceParam:
description: Only patchnotes newer than this date (YYYY-MM-DD)
explode: true
in: query
name: since
required: false
schema:
format: date
type: string
style: form
LimitParam:
description: Maximum number of items to return
explode: true
in: query
name: limit
required: false
schema:
default: 20
maximum: 100
minimum: 1
type: integer
style: form
OffsetParam:
description: Pagination offset
explode: true
in: query
name: offset
required: false
schema:
default: 0
minimum: 0
type: integer
style: form
responses:
Error400:
description: Invalid request payload
Error404:
description: Resource not found
schemas:
patch_notes:
example:
patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9
title: Patch note 1
changes: changes
changes: Fixed export bug
version: 1.0.0
patch_date: 2025-01-02
properties:
patchID:
format: uuid
title: patchID
type: string
title:
type: string
changes:
type: string
version:
type: string
patch_date:
format: date
type: string
required:
- changes
- patchID
- patch_date
- title
- version
title: patch_notes
type: object
patch_notes_input:
description: Schema for POST/PUT (server generates patchID & patch_date if omitted)
properties:
title:
title: title
type: string
@@ -142,6 +246,7 @@ components:
title: version
type: string
patch_date:
format: date
title: patch_date
type: string
required:
@@ -149,12 +254,5 @@ components:
- patch_date
- title
- version
title: patch_notes
user:
example:
lastSeenDate: 2025-01-02
properties:
lastSeenDate:
format: date
title: lastNoteChecked
type: string
title: patch_notes_input
type: object