From 74b50b266e627117e2c641d28e5bd56051c0065d Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Thu, 3 Oct 2024 15:50:34 +0200 Subject: [PATCH] :label: Add typehints to remove redoc warnings --- .../klantinteracties/api/serializers/klantcontacten.py | 2 +- .../components/klantinteracties/api/serializers/partijen.py | 6 +++--- src/openklant/components/klantinteracties/openapi.yaml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openklant/components/klantinteracties/api/serializers/klantcontacten.py b/src/openklant/components/klantinteracties/api/serializers/klantcontacten.py index 61be7008..88ae8a19 100644 --- a/src/openklant/components/klantinteracties/api/serializers/klantcontacten.py +++ b/src/openklant/components/klantinteracties/api/serializers/klantcontacten.py @@ -209,7 +209,7 @@ class Meta: }, } - def get_volledige_naam(self, obj): + def get_volledige_naam(self, obj) -> str: return obj.get_full_name() @transaction.atomic diff --git a/src/openklant/components/klantinteracties/api/serializers/partijen.py b/src/openklant/components/klantinteracties/api/serializers/partijen.py index 4b246708..66f9b24f 100644 --- a/src/openklant/components/klantinteracties/api/serializers/partijen.py +++ b/src/openklant/components/klantinteracties/api/serializers/partijen.py @@ -115,7 +115,7 @@ class Meta: }, } - def get_categorie_naam(self, obj): + def get_categorie_naam(self, obj) -> str | None: if obj.categorie: return obj.categorie.naam @@ -301,7 +301,7 @@ class Meta: "volledige_naam", ) - def get_volledige_naam(self, obj): + def get_volledige_naam(self, obj) -> str: return obj.get_full_name() @@ -333,7 +333,7 @@ class Meta: "volledige_naam", ) - def get_volledige_naam(self, obj): + def get_volledige_naam(self, obj) -> str: return obj.get_full_name() @transaction.atomic diff --git a/src/openklant/components/klantinteracties/openapi.yaml b/src/openklant/components/klantinteracties/openapi.yaml index 955ec590..e5cd8fc9 100644 --- a/src/openklant/components/klantinteracties/openapi.yaml +++ b/src/openklant/components/klantinteracties/openapi.yaml @@ -3371,6 +3371,7 @@ components: description: De unieke URL van deze categorie binnen deze API. categorieNaam: type: string + nullable: true readOnly: true description: De naam van de gelinkte categorie. beginDatum: