openapi-core/openapi_core/spec/paths.py
2021-05-02 22:07:45 +01:00

14 lines
411 B
Python

from dictpath.paths import AccessorPath
from openapi_core.spec.accessors import SpecAccessor
SPEC_SEPARATOR = '#'
class SpecPath(AccessorPath):
@classmethod
def from_spec(cls, spec_dict, dereferencer=None, *args, **kwargs):
separator = kwargs.pop('separator', SPEC_SEPARATOR)
accessor = SpecAccessor(spec_dict, dereferencer)
return cls(accessor, *args, separator=separator)