Skip to content

Commit a903de9

Browse files
committed
fixup! fixup! fixup! fixup! fixup! 📝 [#667] Improve typing information in API schema
1 parent 9edbce8 commit a903de9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/objecttypes/api/serializers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ def create(self, validated_data):
6868

6969

7070
class ObjectTypeSerializer(serializers.HyperlinkedModelSerializer):
71-
labels = serializers.JSONField(
72-
source="get_labels",
73-
required=False,
74-
help_text=get_help_text("core.ObjectType", "labels"),
71+
labels = serializers.SerializerMethodField(
72+
help_text=get_help_text("core.ObjectType", "labels")
7573
)
7674

7775
@extend_schema_field(OpenApiTypes.OBJECT)

src/objecttypes/api/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ components:
526526
description: Link to the documentation for the object type
527527
maxLength: 200
528528
labels:
529+
type: object
530+
additionalProperties: {}
531+
readOnly: true
529532
description: Key-value pairs of keywords related for the object type
530533
createdAt:
531534
type: string
@@ -734,6 +737,9 @@ components:
734737
description: Link to the documentation for the object type
735738
maxLength: 200
736739
labels:
740+
type: object
741+
additionalProperties: {}
742+
readOnly: true
737743
description: Key-value pairs of keywords related for the object type
738744
createdAt:
739745
type: string

0 commit comments

Comments
 (0)