openapi-core/openapi_core/spec/paths.py

15 lines
411 B
Python
Raw Normal View History

2021-04-23 11:36:27 +00:00
from dictpath.paths import AccessorPath
from openapi_core.spec.accessors import SpecAccessor
SPEC_SEPARATOR = '#'
class SpecPath(AccessorPath):
@classmethod
2021-04-27 21:39:28 +00:00
def from_spec(cls, spec_dict, dereferencer=None, *args, **kwargs):
separator = kwargs.pop('separator', SPEC_SEPARATOR)
2021-04-23 11:36:27 +00:00
accessor = SpecAccessor(spec_dict, dereferencer)
return cls(accessor, *args, separator=separator)