diff --git a/openapi_core/spec/accessors.py b/openapi_core/spec/accessors.py index 2687d523..034cf18a 100644 --- a/openapi_core/spec/accessors.py +++ b/openapi_core/spec/accessors.py @@ -1,16 +1,16 @@ from contextlib import contextmanager -from dictpath.accessors import DictOrListAccessor +from pathable.accessors import LookupAccessor -class SpecAccessor(DictOrListAccessor): - def __init__(self, dict_or_list, dereferencer): - super().__init__(dict_or_list) +class SpecAccessor(LookupAccessor): + def __init__(self, lookup, dereferencer): + super().__init__(lookup) self.dereferencer = dereferencer @contextmanager def open(self, parts): - content = self.dict_or_list + content = self.lookup for part in parts: content = content[part] if "$ref" in content: diff --git a/openapi_core/spec/paths.py b/openapi_core/spec/paths.py index 03bb8080..c2f68506 100644 --- a/openapi_core/spec/paths.py +++ b/openapi_core/spec/paths.py @@ -1,4 +1,4 @@ -from dictpath.paths import AccessorPath +from pathable.paths import AccessorPath from openapi_core.spec.accessors import SpecAccessor diff --git a/poetry.lock b/poetry.lock index 7ffc27fc..df812ea8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -141,14 +141,6 @@ tomli = {version = "*", optional = true, markers = "extra == \"toml\""} [package.extras] toml = ["tomli"] -[[package]] -name = "dictpath" -version = "0.1.3" -description = "Object-oriented dictionary paths" -category = "main" -optional = false -python-versions = ">= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*, != 3.4.*" - [[package]] name = "distlib" version = "0.3.4" @@ -470,6 +462,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "pathable" +version = "0.4.0" +description = "Object-oriented paths" +category = "main" +optional = false +python-versions = ">=3.7.0,<4.0.0" + [[package]] name = "pathspec" version = "0.9.0" @@ -930,7 +930,7 @@ requests = ["requests"] [metadata] lock-version = "1.1" python-versions = "^3.7.0" -content-hash = "4631cab8bc13d5fca2ac4de30d3975dfb636bde67c76f3353abee3fad42ba5eb" +content-hash = "c98fe6b41cca1fdf973e28609b42d139df5c129d488645ecbb76ecf9137cce44" [metadata.files] alabaster = [ @@ -1023,11 +1023,6 @@ coverage = [ {file = "coverage-6.3-pp36.pp37.pp38-none-any.whl", hash = "sha256:27ac7cb84538e278e07569ceaaa6f807a029dc194b1c819a9820b9bb5dbf63ab"}, {file = "coverage-6.3.tar.gz", hash = "sha256:987a84ff98a309994ca77ed3cc4b92424f824278e48e4bf7d1bb79a63cfe2099"}, ] -dictpath = [ - {file = "dictpath-0.1.3-py2-none-any.whl", hash = "sha256:225248e3c1e7c375495d5da5c390cbf3490f56ee42c151df733e5b2df6b521b5"}, - {file = "dictpath-0.1.3-py3-none-any.whl", hash = "sha256:d5212361d1fb93909cff715f6e0404e17752cf7a48df3e140639e529a027c437"}, - {file = "dictpath-0.1.3.tar.gz", hash = "sha256:751cde3b76b176d25f961b90c423a11a4d5ede9bd09ab0d64a85abb738c190d8"}, -] distlib = [ {file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"}, {file = "distlib-0.3.4.zip", hash = "sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579"}, @@ -1196,6 +1191,10 @@ packaging = [ parse = [ {file = "parse-1.19.0.tar.gz", hash = "sha256:9ff82852bcb65d139813e2a5197627a94966245c897796760a3a2a8eb66f020b"}, ] +pathable = [ + {file = "pathable-0.4.0-py3-none-any.whl", hash = "sha256:6b4d20220a19dc1612a0e05f1d3734acf398131d005bd2a406dbd1394d4f6f06"}, + {file = "pathable-0.4.0.tar.gz", hash = "sha256:da4eb6a827355c2a5792b26d59ab801fcd25ef10f6ed60098ec248eb780052e3"}, +] pathspec = [ {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, diff --git a/pyproject.toml b/pyproject.toml index 349572cf..b8c1dc9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.7.0" -dictpath = "*" +pathable = "^0.4.0" django = {version = ">=3.0", optional = true} falcon = {version = ">=3.0", optional = true} flask = {version = "*", optional = true}