Compare commits
2 Commits
1da5748734
...
bbe550b8a9
| Author | SHA1 | Date |
|---|---|---|
|
|
bbe550b8a9 | |
|
|
de15af4302 |
|
|
@ -151,13 +151,16 @@ components:
|
||||||
patch_date:
|
patch_date:
|
||||||
type: string
|
type: string
|
||||||
format: date
|
format: date
|
||||||
required: [patchID, title, changes, version, patch_date]
|
project:
|
||||||
|
type: string
|
||||||
|
required: [patchID, title, changes, version, patch_date, project]
|
||||||
example:
|
example:
|
||||||
patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9
|
patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9
|
||||||
title: Patch note 1
|
title: Patch note 1
|
||||||
changes: Fixed export bug
|
changes: Fixed export bug
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
patch_date: '2025-01-02' # ← als String in Quotes!
|
patch_date: '2025-01-02' # ← als String in Quotes!
|
||||||
|
project: 'Test-Projekt'
|
||||||
|
|
||||||
patch_notes_input:
|
patch_notes_input:
|
||||||
description: Schema for POST/PUT (server generates patchID if omitted)
|
description: Schema for POST/PUT (server generates patchID if omitted)
|
||||||
|
|
@ -172,12 +175,15 @@ components:
|
||||||
patch_date:
|
patch_date:
|
||||||
type: string
|
type: string
|
||||||
format: date
|
format: date
|
||||||
required: [title, changes, version, patch_date]
|
project:
|
||||||
|
type: string
|
||||||
|
required: [title, changes, version, patch_date, project]
|
||||||
example:
|
example:
|
||||||
title: Patch note 1
|
title: Patch note 1
|
||||||
changes: Fixed export bug
|
changes: Fixed export bug
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
patch_date: '2025-01-02' # ← ebenfalls in Quotes
|
patch_date: '2025-01-02' # ← ebenfalls in Quotes
|
||||||
|
project: 'Test-Projekt'
|
||||||
|
|
||||||
responses:
|
responses:
|
||||||
Error400:
|
Error400:
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,9 @@ Dockerfile
|
||||||
README.md
|
README.md
|
||||||
git_push.sh
|
git_push.sh
|
||||||
openapi_server/__init__.py
|
openapi_server/__init__.py
|
||||||
openapi_server/__main__.py
|
|
||||||
openapi_server/controllers/__init__.py
|
openapi_server/controllers/__init__.py
|
||||||
openapi_server/controllers/patchnotes_controller.py
|
|
||||||
openapi_server/controllers/security_controller.py
|
openapi_server/controllers/security_controller.py
|
||||||
openapi_server/models/__init__.py
|
openapi_server/models/__init__.py
|
||||||
openapi_server/models/base_model.py
|
|
||||||
openapi_server/models/patch_notes.py
|
openapi_server/models/patch_notes.py
|
||||||
openapi_server/models/patch_notes_input.py
|
openapi_server/models/patch_notes_input.py
|
||||||
openapi_server/openapi/openapi.yaml
|
openapi_server/openapi/openapi.yaml
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ def create_patchnote(body): # noqa: E501
|
||||||
|
|
||||||
pn = PatchNotes.from_dict(body)
|
pn = PatchNotes.from_dict(body)
|
||||||
|
|
||||||
# --- Datum wahlweise als str oder date annehmen ---
|
# --- Datum wahlweise als str oder Date annehmen ---
|
||||||
if isinstance(pn.patch_date, date):
|
if isinstance(pn.patch_date, date):
|
||||||
date_str = pn.patch_date.isoformat()
|
date_str = pn.patch_date.isoformat()
|
||||||
else:
|
else:
|
||||||
|
|
@ -56,6 +56,7 @@ def create_patchnote(body): # noqa: E501
|
||||||
"changes": pn.changes,
|
"changes": pn.changes,
|
||||||
"version": pn.version,
|
"version": pn.version,
|
||||||
"patch_date": date_str,
|
"patch_date": date_str,
|
||||||
|
"project": pn.project
|
||||||
}
|
}
|
||||||
|
|
||||||
collection.insert_one(patch_doc)
|
collection.insert_one(patch_doc)
|
||||||
|
|
@ -199,6 +200,7 @@ def update_patchnote(patch_id, body): # noqa: E501
|
||||||
"changes": pn.changes,
|
"changes": pn.changes,
|
||||||
"version": pn.version,
|
"version": pn.version,
|
||||||
"patch_date": date_str, # richtiger Feldname!
|
"patch_date": date_str, # richtiger Feldname!
|
||||||
|
"project": pn.project,
|
||||||
}}
|
}}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class PatchNotes(Model):
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, patch_id=None, title=None, changes=None, version=None, patch_date=None): # noqa: E501
|
def __init__(self, patch_id=None, title=None, changes=None, version=None, patch_date=None, project=None): # noqa: E501
|
||||||
"""PatchNotes - a model defined in OpenAPI
|
"""PatchNotes - a model defined in OpenAPI
|
||||||
|
|
||||||
:param patch_id: The patch_id of this PatchNotes. # noqa: E501
|
:param patch_id: The patch_id of this PatchNotes. # noqa: E501
|
||||||
|
|
@ -25,13 +25,16 @@ class PatchNotes(Model):
|
||||||
:type version: str
|
:type version: str
|
||||||
:param patch_date: The patch_date of this PatchNotes. # noqa: E501
|
:param patch_date: The patch_date of this PatchNotes. # noqa: E501
|
||||||
:type patch_date: date
|
:type patch_date: date
|
||||||
|
:param project: The project of this PatchNotes. # noqa: E501
|
||||||
|
:type project: str
|
||||||
"""
|
"""
|
||||||
self.openapi_types = {
|
self.openapi_types = {
|
||||||
'patch_id': str,
|
'patch_id': str,
|
||||||
'title': str,
|
'title': str,
|
||||||
'changes': str,
|
'changes': str,
|
||||||
'version': str,
|
'version': str,
|
||||||
'patch_date': date
|
'patch_date': date,
|
||||||
|
'project': str
|
||||||
}
|
}
|
||||||
|
|
||||||
self.attribute_map = {
|
self.attribute_map = {
|
||||||
|
|
@ -39,7 +42,8 @@ class PatchNotes(Model):
|
||||||
'title': 'title',
|
'title': 'title',
|
||||||
'changes': 'changes',
|
'changes': 'changes',
|
||||||
'version': 'version',
|
'version': 'version',
|
||||||
'patch_date': 'patch_date'
|
'patch_date': 'patch_date',
|
||||||
|
'project': 'project'
|
||||||
}
|
}
|
||||||
|
|
||||||
self._patch_id = patch_id
|
self._patch_id = patch_id
|
||||||
|
|
@ -47,6 +51,7 @@ class PatchNotes(Model):
|
||||||
self._changes = changes
|
self._changes = changes
|
||||||
self._version = version
|
self._version = version
|
||||||
self._patch_date = patch_date
|
self._patch_date = patch_date
|
||||||
|
self._project = project
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, dikt) -> 'PatchNotes':
|
def from_dict(cls, dikt) -> 'PatchNotes':
|
||||||
|
|
@ -173,3 +178,26 @@ class PatchNotes(Model):
|
||||||
raise ValueError("Invalid value for `patch_date`, must not be `None`") # noqa: E501
|
raise ValueError("Invalid value for `patch_date`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._patch_date = patch_date
|
self._patch_date = patch_date
|
||||||
|
|
||||||
|
@property
|
||||||
|
def project(self) -> str:
|
||||||
|
"""Gets the project of this PatchNotes.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The project of this PatchNotes.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._project
|
||||||
|
|
||||||
|
@project.setter
|
||||||
|
def project(self, project: str):
|
||||||
|
"""Sets the project of this PatchNotes.
|
||||||
|
|
||||||
|
|
||||||
|
:param project: The project of this PatchNotes.
|
||||||
|
:type project: str
|
||||||
|
"""
|
||||||
|
if project is None:
|
||||||
|
raise ValueError("Invalid value for `project`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
|
self._project = project
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class PatchNotesInput(Model):
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, title=None, changes=None, version=None, patch_date=None): # noqa: E501
|
def __init__(self, title=None, changes=None, version=None, patch_date=None, project=None): # noqa: E501
|
||||||
"""PatchNotesInput - a model defined in OpenAPI
|
"""PatchNotesInput - a model defined in OpenAPI
|
||||||
|
|
||||||
:param title: The title of this PatchNotesInput. # noqa: E501
|
:param title: The title of this PatchNotesInput. # noqa: E501
|
||||||
|
|
@ -23,25 +23,30 @@ class PatchNotesInput(Model):
|
||||||
:type version: str
|
:type version: str
|
||||||
:param patch_date: The patch_date of this PatchNotesInput. # noqa: E501
|
:param patch_date: The patch_date of this PatchNotesInput. # noqa: E501
|
||||||
:type patch_date: date
|
:type patch_date: date
|
||||||
|
:param project: The project of this PatchNotesInput. # noqa: E501
|
||||||
|
:type project: str
|
||||||
"""
|
"""
|
||||||
self.openapi_types = {
|
self.openapi_types = {
|
||||||
'title': str,
|
'title': str,
|
||||||
'changes': str,
|
'changes': str,
|
||||||
'version': str,
|
'version': str,
|
||||||
'patch_date': date
|
'patch_date': date,
|
||||||
|
'project': str
|
||||||
}
|
}
|
||||||
|
|
||||||
self.attribute_map = {
|
self.attribute_map = {
|
||||||
'title': 'title',
|
'title': 'title',
|
||||||
'changes': 'changes',
|
'changes': 'changes',
|
||||||
'version': 'version',
|
'version': 'version',
|
||||||
'patch_date': 'patch_date'
|
'patch_date': 'patch_date',
|
||||||
|
'project': 'project'
|
||||||
}
|
}
|
||||||
|
|
||||||
self._title = title
|
self._title = title
|
||||||
self._changes = changes
|
self._changes = changes
|
||||||
self._version = version
|
self._version = version
|
||||||
self._patch_date = patch_date
|
self._patch_date = patch_date
|
||||||
|
self._project = project
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, dikt) -> 'PatchNotesInput':
|
def from_dict(cls, dikt) -> 'PatchNotesInput':
|
||||||
|
|
@ -145,3 +150,26 @@ class PatchNotesInput(Model):
|
||||||
raise ValueError("Invalid value for `patch_date`, must not be `None`") # noqa: E501
|
raise ValueError("Invalid value for `patch_date`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
self._patch_date = patch_date
|
self._patch_date = patch_date
|
||||||
|
|
||||||
|
@property
|
||||||
|
def project(self) -> str:
|
||||||
|
"""Gets the project of this PatchNotesInput.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The project of this PatchNotesInput.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._project
|
||||||
|
|
||||||
|
@project.setter
|
||||||
|
def project(self, project: str):
|
||||||
|
"""Sets the project of this PatchNotesInput.
|
||||||
|
|
||||||
|
|
||||||
|
:param project: The project of this PatchNotesInput.
|
||||||
|
:type project: str
|
||||||
|
"""
|
||||||
|
if project is None:
|
||||||
|
raise ValueError("Invalid value for `project`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
|
self._project = project
|
||||||
|
|
|
||||||
|
|
@ -22,27 +22,6 @@ paths:
|
||||||
format: date
|
format: date
|
||||||
type: string
|
type: string
|
||||||
style: form
|
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:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
content:
|
content:
|
||||||
|
|
@ -86,6 +65,24 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Patchnotes
|
- Patchnotes
|
||||||
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
|
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
|
||||||
|
/patchnotes/all:
|
||||||
|
get:
|
||||||
|
operationId: list_all_patchnotes
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/patch_notes'
|
||||||
|
type: array
|
||||||
|
description: list of all patch notes
|
||||||
|
"404":
|
||||||
|
description: no Patch notes found
|
||||||
|
summary: Returns **all** patch notes (admin area)
|
||||||
|
tags:
|
||||||
|
- Patchnotes
|
||||||
|
x-openapi-router-controller: openapi_server.controllers.patchnotes_controller
|
||||||
/patchnotes/{patchID}:
|
/patchnotes/{patchID}:
|
||||||
delete:
|
delete:
|
||||||
operationId: delete_patchnote
|
operationId: delete_patchnote
|
||||||
|
|
@ -176,29 +173,6 @@ components:
|
||||||
format: date
|
format: date
|
||||||
type: string
|
type: string
|
||||||
style: form
|
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:
|
responses:
|
||||||
Error400:
|
Error400:
|
||||||
description: Invalid request payload
|
description: Invalid request payload
|
||||||
|
|
@ -212,6 +186,7 @@ components:
|
||||||
changes: Fixed export bug
|
changes: Fixed export bug
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
patch_date: 2025-01-02
|
patch_date: 2025-01-02
|
||||||
|
project: Test-Projekt
|
||||||
properties:
|
properties:
|
||||||
patchID:
|
patchID:
|
||||||
format: uuid
|
format: uuid
|
||||||
|
|
@ -225,33 +200,41 @@ components:
|
||||||
patch_date:
|
patch_date:
|
||||||
format: date
|
format: date
|
||||||
type: string
|
type: string
|
||||||
|
project:
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- changes
|
- changes
|
||||||
- patchID
|
- patchID
|
||||||
- patch_date
|
- patch_date
|
||||||
|
- project
|
||||||
- title
|
- title
|
||||||
- version
|
- version
|
||||||
title: patch_notes
|
title: patch_notes
|
||||||
type: object
|
type: object
|
||||||
patch_notes_input:
|
patch_notes_input:
|
||||||
description: Schema for POST/PUT (server generates patchID & patch_date if omitted)
|
description: Schema for POST/PUT (server generates patchID if omitted)
|
||||||
|
example:
|
||||||
|
title: Patch note 1
|
||||||
|
changes: Fixed export bug
|
||||||
|
version: 1.0.0
|
||||||
|
patch_date: 2025-01-02
|
||||||
|
project: Test-Projekt
|
||||||
properties:
|
properties:
|
||||||
title:
|
title:
|
||||||
title: title
|
|
||||||
type: string
|
type: string
|
||||||
changes:
|
changes:
|
||||||
title: changes
|
|
||||||
type: string
|
type: string
|
||||||
version:
|
version:
|
||||||
title: version
|
|
||||||
type: string
|
type: string
|
||||||
patch_date:
|
patch_date:
|
||||||
format: date
|
format: date
|
||||||
title: patch_date
|
type: string
|
||||||
|
project:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- changes
|
- changes
|
||||||
- patch_date
|
- patch_date
|
||||||
|
- project
|
||||||
- title
|
- title
|
||||||
- version
|
- version
|
||||||
title: patch_notes_input
|
title: patch_notes_input
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue