Skip to content

switch to pathable #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions openapi_core/spec/accessors.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion openapi_core/spec/paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dictpath.paths import AccessorPath
from pathable.paths import AccessorPath

from openapi_core.spec.accessors import SpecAccessor

Expand Down
27 changes: 13 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down