Skip to content

Commit

Permalink
fix(api): force to type to be object
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed May 29, 2024
1 parent b78130d commit cc83ca3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apis_ontology/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from apis_core.apis_relations.models import TempTriple
from django.contrib.contenttypes.models import ContentType
from apis_bibsonomy.models import Reference
from drf_spectacular.utils import extend_schema_field
from drf_spectacular.types import OpenApiTypes


class SimpleObjectSerializer(serializers.Serializer):
Expand Down Expand Up @@ -54,6 +56,7 @@ def get_family_relation(self, obj):
return True
return False

@extend_schema_field(OpenApiTypes.OBJECT)
def get_to(self, obj):
if self.context["obj"] == obj.obj:
return SimpleObjectSerializer(obj.subj).data
Expand Down

0 comments on commit cc83ca3

Please sign in to comment.