Skip to content

Commit

Permalink
[#210] use correct target class for HyperlinkedRelatedFieldExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonny Bakker committed Sep 29, 2022
1 parent a008cd8 commit 55dee16
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vng_api_common/inspectors/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def map_serializer_field(self, auto_schema, direction):


class HyperlinkedRelatedFieldExtension(OpenApiSerializerFieldExtension):
target_class = "rest_framework.relations.HyperlinkedRelatedField"
target_class = "vng_api_common.serializers.LengthHyperlinkedRelatedField"
match_subclasses = True

def map_serializer_field(self, auto_schema, direction):
Expand All @@ -62,9 +62,9 @@ def map_serializer_field(self, auto_schema, direction):

return {
**default_schema,
"description": "URL-referentie naar dit object. Dit is de unieke identificatie en locatie van dit object.",
"min_length": 1,
"max_length": 1000,
"description": self.target.help_text,
"min_length": self.target.min_length,
"max_length": self.target.max_length,
}


Expand All @@ -79,9 +79,9 @@ def map_serializer_field(self, auto_schema, direction):

return {
**default_schema,
"description": self.target.help_text,
"min_length": self.target.min_length,
"max_length": self.target.max_length,
"description": "URL-referentie naar dit object. Dit is de unieke identificatie en locatie van dit object.",
"min_length": 1,
"max_length": 1000,
}


Expand Down

0 comments on commit 55dee16

Please sign in to comment.