Skip to content

Commit

Permalink
[VNG-Realisatie#210] return dict instead of ResolvedComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonny Bakker committed Sep 19, 2022
1 parent 2865922 commit b0dabff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vng_api_common/inspectors/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
OpenApiSerializerExtension,
OpenApiSerializerFieldExtension,
)
from drf_spectacular.plumbing import ResolvedComponent
from drf_spectacular.types import PYTHON_TYPE_MAPPING as TYPES_MAP


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -45,7 +43,10 @@ def map_serializer_field(self, auto_schema, direction):
if type_ is None:
logger.debug("Missing type mapping for %r", return_type)

return ResolvedComponent(self.target.field_name, type_ or TYPES_MAP[str])
return {
**default_schema,
"type": type_,
}


class HyperlinkedRelatedFieldExtension(OpenApiSerializerFieldExtension):
Expand Down

0 comments on commit b0dabff

Please sign in to comment.