version field added to yaml, requirements.txt updated, patchnotes_controller.py changed accordingly

This commit is contained in:
Justin Weins 2025-04-16 08:53:28 +02:00
parent 33a2e33671
commit 814dd4d2c2
6 changed files with 54 additions and 14 deletions

View File

@ -96,6 +96,7 @@ components:
patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9 patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9
title: Patch note 1 title: Patch note 1
changes: changes changes: changes
version: 1.0.0
date: 2025-01-02 date: 2025-01-02
properties: properties:
patchID: patchID:
@ -108,6 +109,9 @@ components:
changes: changes:
type: string type: string
title: changes title: changes
version:
type: string
title: version
patch_date: patch_date:
title: patch_date title: patch_date
type: string type: string
@ -115,6 +119,7 @@ components:
- "title" - "title"
- "changes" - "changes"
- "patch_date" - "patch_date"
- "version"
user: user:
example: example:
lastSeenDate: 2025-01-02 lastSeenDate: 2025-01-02

View File

@ -25,3 +25,4 @@
openapi_server/__main__.py openapi_server/__main__.py
openapi_server/encoder.py openapi_server/encoder.py
openapi_server/models/base_model.py openapi_server/models/base_model.py
openapi_server/controllers/patchnotes_controller.py

View File

@ -97,6 +97,7 @@ def patchnotes_patch_idput(patch_id, body): # noqa: E501
{ {
'title': pn.title, 'title': pn.title,
'changes': pn.changes, 'changes': pn.changes,
'version': pn.version,
'date': date_str 'date': date_str
} }
} }
@ -142,6 +143,7 @@ def patchnotes_post(body):
'patchID': str(uuid.uuid4()), 'patchID': str(uuid.uuid4()),
'title': pn.title, 'title': pn.title,
'changes': pn.changes, 'changes': pn.changes,
'version': pn.version,
'patch_date': date_str 'patch_date': date_str
} }

View File

@ -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, patch_date=None): # noqa: E501 def __init__(self, patch_id=None, title=None, changes=None, version=None, patch_date=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
@ -21,6 +21,8 @@ class PatchNotes(Model):
:type title: str :type title: str
:param changes: The changes of this PatchNotes. # noqa: E501 :param changes: The changes of this PatchNotes. # noqa: E501
:type changes: str :type changes: str
:param version: The version of this PatchNotes. # noqa: E501
: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: str :type patch_date: str
""" """
@ -28,6 +30,7 @@ class PatchNotes(Model):
'patch_id': str, 'patch_id': str,
'title': str, 'title': str,
'changes': str, 'changes': str,
'version': str,
'patch_date': str 'patch_date': str
} }
@ -35,12 +38,14 @@ class PatchNotes(Model):
'patch_id': 'patchID', 'patch_id': 'patchID',
'title': 'title', 'title': 'title',
'changes': 'changes', 'changes': 'changes',
'version': 'version',
'patch_date': 'patch_date' 'patch_date': 'patch_date'
} }
self._patch_id = patch_id self._patch_id = patch_id
self._title = title self._title = title
self._changes = changes self._changes = changes
self._version = version
self._patch_date = patch_date self._patch_date = patch_date
@classmethod @classmethod
@ -121,6 +126,29 @@ class PatchNotes(Model):
self._changes = changes self._changes = changes
@property
def version(self) -> str:
"""Gets the version of this PatchNotes.
:return: The version of this PatchNotes.
:rtype: str
"""
return self._version
@version.setter
def version(self, version: str):
"""Sets the version of this PatchNotes.
:param version: The version of this PatchNotes.
:type version: str
"""
if version is None:
raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501
self._version = version
@property @property
def patch_date(self) -> str: def patch_date(self) -> str:
"""Gets the patch_date of this PatchNotes. """Gets the patch_date of this PatchNotes.

View File

@ -108,6 +108,7 @@ components:
patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9 patchID: 29e80bcc-5981-4a52-99e1-373442dea9b9
title: Patch note 1 title: Patch note 1
changes: changes changes: changes
version: 1.0.0
date: 2025-01-02 date: 2025-01-02
properties: properties:
patchID: patchID:
@ -120,6 +121,9 @@ components:
changes: changes:
title: changes title: changes
type: string type: string
version:
title: version
type: string
patch_date: patch_date:
title: patch_date title: patch_date
type: string type: string
@ -127,6 +131,7 @@ components:
- changes - changes
- patch_date - patch_date
- title - title
- version
title: patch_notes title: patch_notes
user: user:
example: example:

View File

@ -1,13 +1,12 @@
connexion[swagger-ui] >= 2.6.0; python_version>="3.6" python_dateutil >= 2.5.3
# 2.3 is the last version that supports python 3.4-3.5
connexion[swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4"
# prevent breaking dependencies from advent of connexion>=3.0
connexion[swagger-ui] <= 2.14.2; python_version>"3.4"
# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug
# we must peg werkzeug versions below to fix connexion
# https://github.com/zalando/connexion/pull/1044
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
setuptools >= 21.0.0 setuptools >= 21.0.0
Flask == 2.1.1 urllib3 >= 2.2.2, < 2.3.0
pydantic >= 2
typing-extensions >= 4.7.1
Flask >= 3.1.0
Flask-PyMongo >= 3.0.1
pymongo >= 4.11.3
connexion[swagger-ui, flask] >= 3.2.0
werkzeug == 3.1.3
swagger-ui-bundle >= 0.0.2
uvicorn >= 0.21.1