diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 795c61f..262f728 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -3,6 +3,11 @@ Changelog
 =========
 
 
+dev
+---
+
+* fix integer response code raising exception (closes #14)
+
 0.1.16   (2020-02-08)
 ---------------------
 
diff --git a/src/oasapi/jspaths.py b/src/oasapi/jspaths.py
new file mode 100644
index 0000000..cdcf67e
--- /dev/null
+++ b/src/oasapi/jspaths.py
@@ -0,0 +1,25 @@
+from jsonpath_ng import parse, Union, Child
+
+from oasapi.common import OPERATIONS_LOWER, REFERENCE_SECTIONS
+
+# list of JSPATH for different structures
+
+JSPATH_INFO = parse(f"info")
+JSPATH_ENDPOINTS = parse(f"paths.*")
+JSPATH_OPERATIONS = Child(JSPATH_ENDPOINTS, parse(f"({'|'.join(OPERATIONS_LOWER)})"))
+JSPATH_OPERATION_RESPONSES = Child(JSPATH_OPERATIONS, parse("responses"))
+JSPATH_OPERATIONID = Child(JSPATH_OPERATIONS, parse("operationId"))
+JSPATH_OPERATION_TAGS = Child(JSPATH_OPERATIONS, parse(f"tags"))
+JSPATH_SECURITY_OPERATION = Child(JSPATH_OPERATIONS, parse("security.[*].*"))
+JSPATH_SECURITY_GLOBAL = parse("security.[*].*")
+JSPATH_SECURITY = Union(JSPATH_SECURITY_GLOBAL, JSPATH_SECURITY_OPERATION)
+JSPATH_PARAMETERS_GLOBAL = parse("parameters.[*]")
+JSPATH_PARAMETERS_PATH = parse(f"paths.*.parameters.[*]")
+JSPATH_PARAMETERS_OPERATION = Child(JSPATH_OPERATIONS, parse("parameters.[*]"))
+JSPATH_PARAMETERS = Union(
+    JSPATH_PARAMETERS_GLOBAL, Union(JSPATH_PARAMETERS_PATH, JSPATH_PARAMETERS_OPERATION)
+)
+JSPATH_PATHS_REFERENCES = parse("paths..'$ref'")
+JSPATH_REFERENCES = parse("$..'$ref'")
+JSPATH_COMPONENTS = parse(f"$.({'|'.join(REFERENCE_SECTIONS)}).*")
+JSPATH_TAGS = parse("tags.[*].name")
diff --git a/src/oasapi/validation.py b/src/oasapi/validation.py
index 51afa73..896c748 100644
--- a/src/oasapi/validation.py
+++ b/src/oasapi/validation.py
@@ -11,13 +11,13 @@ from typing import Set, Dict, Tuple, List
 
 from jsonschema import Draft4Validator
 
-from oasapi.common import (
-    get_elements,
-    REFERENCE_SECTIONS,
+from oasapi.common import get_elements, REFERENCE_SECTIONS
+from oasapi.jspaths import (
     JSPATH_SECURITY,
     JSPATH_PARAMETERS,
     JSPATH_REFERENCES,
     JSPATH_OPERATIONID,
+    JSPATH_OPERATION_RESPONSES,
 )
 from .events import (
     ReferenceNotFoundValidationError,
@@ -308,6 +308,12 @@ def check_schema(swagger: Dict) -> Set[ValidationError]:
     schema = json.load((Path(__file__).parent / "schemas" / "schema_swagger.json").open())
     v = Draft4Validator(schema)
 
+    # convert any key to string (as json swagger expects all keys to be str and response code are sometimes integer)
+    for name, value, path in get_elements(swagger, JSPATH_OPERATION_RESPONSES):
+        for k in list(value.keys()):
+            if isinstance(k, int):
+                value[str(k)] = value.pop(k)
+
     return {
         JsonSchemaValidationError(path=tuple(error.absolute_path), reason=error.message)
         for error in v.iter_errors(swagger)

integer status codes trigger exception in validation
the jsonschema validator expects all keys of the swagger to be strings.
if a swagger is given in yaml format with integer values for response codes, the jsonschema will crash
diff --git a/tests/test_validation.py b/tests/test_validation.py
index c9232f9..873f9fa 100644
--- a/tests/test_validation.py
+++ b/tests/test_validation.py
@@ -130,6 +130,39 @@ paths:
     }
 
 
+def test_check_schema_integer_as_response_code():
+    swagger_str = """
+swagger: '2.0'
+info:
+  version: 1.0
+  title: my api
+paths:
+  /foo:
+    get:
+      responses:
+        200:
+          $ref: "#/definitions/some-definition"
+      security:
+      - baz: "not-a-list"
+    """
+    swagger = yaml.safe_load(swagger_str)
+    results = check_schema(swagger)
+
+    # no error in this basic test
+    assert results == {
+        JsonSchemaValidationError(
+            path=("info", "version"),
+            reason="1.0 is not of type 'string'",
+            type="Json schema validator error",
+        ),
+        JsonSchemaValidationError(
+            path=("paths", "/foo", "get", "security", 0, "baz"),
+            reason="'not-a-list' is not of type 'array'",
+            type="Json schema validator error",
+        ),
+    }
+
+
 def test_check_references():
     swagger_str = """
 swagger: '2.0'

pip install -e .
parse_log_pytest
pytest
pytest
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///croot/attrs_1668696182826/work
certifi @ file:///croot/certifi_1671487769961/work/certifi
click==8.1.8
deepmerge==1.1.1
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1648562407465/work
importlib-resources==5.12.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
jsonpath-ng==1.7.0
jsonschema==4.17.3
-e git+https://github.com/sdementen/oasapi.git@6da65344b97878cb2c39c2cbc1d377231eb81c58#egg=oasapi
packaging @ file:///croot/packaging_1671697413597/work
pkgutil_resolve_name==1.3.10
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
ply==3.11
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyrsistent==0.19.3
pytest==7.1.2
PyYAML==6.0.1
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
typing_extensions @ file:///croot/typing_extensions_1669924550328/work
zipp @ file:///croot/zipp_1672387121353/work

name: oasapi
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
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib-metadata=4.11.3=py37h06a4308_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_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=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - typing_extensions=4.4.0=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - click==8.1.8
      - deepmerge==1.1.1
      - importlib-resources==5.12.0
      - jsonpath-ng==1.7.0
      - jsonschema==4.17.3
      - pkgutil-resolve-name==1.3.10
      - ply==3.11
      - pyrsistent==0.19.3
      - pyyaml==6.0.1
prefix: /opt/conda/envs/oasapi

tests/test_validation.py::test_check_schema_integer_as_response_code
tests/test_validation.py::test_minimal_compliant_swagger tests/test_validation.py::test_empty_swagger tests/test_validation.py::test_schema_error tests/test_validation.py::test_check_schema tests/test_validation.py::test_check_references tests/test_validation.py::test_detect_duplicate_operationId tests/test_validation.py::test_check_parameters tests/test_validation.py::test_check_parameters_array_recurse tests/test_validation.py::test_check_security
CHANGELOG.rst src/oasapi/jspaths.py src/oasapi/validation.py
CHANGELOG.rst src/oasapi/jspaths.py src/oasapi/validation.py