Skip to content

Commit

Permalink
Add field_mapping type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Aug 5, 2023
1 parent 95d73b4 commit e4e962b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/apispec/ext/marshmallow/field_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
This module is treated as private API.
Users should not need to use this module directly.
"""
from __future__ import annotations
import re
import functools
import operator
Expand All @@ -18,7 +19,7 @@


# marshmallow field => (JSON Schema type, format)
DEFAULT_FIELD_MAPPING = {
DEFAULT_FIELD_MAPPING: dict[type, tuple[str | None, str | None]] = {
marshmallow.fields.Integer: ("integer", None),
marshmallow.fields.Number: ("number", None),
marshmallow.fields.Float: ("number", None),
Expand Down Expand Up @@ -86,7 +87,7 @@
class FieldConverterMixin:
"""Adds methods for converting marshmallow fields to an OpenAPI properties."""

field_mapping = DEFAULT_FIELD_MAPPING
field_mapping: dict[type, tuple[str | None, str | None]] = DEFAULT_FIELD_MAPPING
openapi_version: Version

def init_attribute_functions(self):
Expand Down

0 comments on commit e4e962b

Please sign in to comment.