diff --git a/apistrap/schematics_converters.py b/apistrap/schematics_converters.py
index 030d697..049cc6d 100644
--- a/apistrap/schematics_converters.py
+++ b/apistrap/schematics_converters.py
@@ -1,4 +1,5 @@
 from typing import Type, Generator, Dict, Any
+from inspect import getmro
 
 from schematics import Model
 from schematics.types.base import (BaseType, NumberType, IntType, LongType, FloatType,
@@ -61,12 +62,22 @@ SCHEMATICS_OPTIONS_TO_JSON_SCHEMA = {
     'regex': 'pattern',
     'min_value': 'minimum',
     'max_value': 'maximum',
+    'min_size': 'minItems',
+    'max_size': 'maxItems'
 }
 
 
+def _get_field_type(field: BaseType):
+    for cls in getmro(field.__class__):
+        if cls in SCHEMATICS_TYPE_TO_JSON_TYPE.keys():
+            return SCHEMATICS_TYPE_TO_JSON_TYPE[cls]
+
+    return 'string'
+
+
 def _primitive_field_to_schema_object(field: BaseType) -> Dict[str, str]:
     schema = {
-        "type": SCHEMATICS_TYPE_TO_JSON_TYPE.get(field.__class__, 'string')
+        "type": _get_field_type(field)
     }
 
     for schematics_attr, json_schema_attr in SCHEMATICS_OPTIONS_TO_JSON_SCHEMA.items():

Handle schematics type subclasses correctly
e.g. `class NonNanFloatType(FloatType)` is converted to string (should be float). https://github.com/iterait/apistrap/blob/dev/apistrap/schematics_converters.py#L69
diff --git a/tests/test_field_subtyping.py b/tests/test_field_subtyping.py
new file mode 100644
index 0000000..e30d2f6
--- /dev/null
+++ b/tests/test_field_subtyping.py
@@ -0,0 +1,45 @@
+import pytest
+from flask import jsonify
+
+from schematics import Model
+from schematics.types import IntType
+
+
+def extract_definition_name(definition_spec: str):
+    return definition_spec.split("/")[-1]
+
+
+class CustomType(IntType):
+    pass
+
+
+class RequestModel(Model):
+    field = CustomType(required=True)
+
+
+@pytest.fixture()
+def app_with_accepts(app, swagger):
+    @app.route("/", methods=["POST"])
+    @swagger.autodoc()
+    @swagger.accepts(RequestModel)
+    def view(req: RequestModel):
+        return jsonify()
+
+
+def test_int_subtype(client, app_with_accepts):
+    spec = client.get("/swagger.json").json
+    path = spec["paths"]["/"]["post"]
+    body = next(filter(lambda item: item["in"] == "body", path["parameters"]), None)
+    assert body is not None
+
+    ref = extract_definition_name(body["schema"]["$ref"])
+    assert spec["definitions"][ref] == {
+        "title": RequestModel.__name__,
+        "type": "object",
+        "properties": {
+            "field": {
+                "type": "integer"
+            }
+        },
+        "required": ["field"]
+    }

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-flask pytest-mock
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/iterait/apistrap.git@ef785bd161bae0562f3e85b959dc7c13ea42465c#egg=apistrap
attrs==25.3.0
blinker==1.9.0
click==8.1.8
exceptiongroup==1.2.2
flasgger==0.9.7.1
Flask==3.1.0
importlib_metadata==8.6.1
iniconfig==2.1.0
itsdangerous==2.2.0
Jinja2==3.1.6
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
MarkupSafe==3.0.2
mistune==3.1.3
more-itertools==10.6.0
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
pytest-flask==1.3.0
pytest-mock==3.14.0
PyYAML==6.0.2
referencing==0.36.2
rpds-py==0.24.0
schematics==2.1.1
six==1.17.0
tomli==2.2.1
typing_extensions==4.13.0
Werkzeug==3.1.3
zipp==3.21.0

name: apistrap
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==25.3.0
      - blinker==1.9.0
      - click==8.1.8
      - exceptiongroup==1.2.2
      - flasgger==0.9.7.1
      - flask==3.1.0
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - itsdangerous==2.2.0
      - jinja2==3.1.6
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - markupsafe==3.0.2
      - mistune==3.1.3
      - more-itertools==10.6.0
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-flask==1.3.0
      - pytest-mock==3.14.0
      - pyyaml==6.0.2
      - referencing==0.36.2
      - rpds-py==0.24.0
      - schematics==2.1.1
      - six==1.17.0
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - werkzeug==3.1.3
      - zipp==3.21.0
prefix: /opt/conda/envs/apistrap

tests/test_field_subtyping.py::test_int_subtype
apistrap/schematics_converters.py
apistrap/schematics_converters.py