File tree Expand file tree Collapse file tree 1 file changed +36
-2
lines changed
swagger_py_codegen/templates/jsonschema Expand file tree Collapse file tree 1 file changed +36
-2
lines changed Original file line number Diff line number Diff line change 22
33import six
44from jsonschema import RefResolver
5- from swagger_py_codegen.parser import RefNode
6-
75# TODO: datetime support
86
7+ class RefNode(object):
8+
9+ def __init__(self, data, ref):
10+ self.ref = ref
11+ self._data = data
12+
13+ def __getitem__(self, key):
14+ return self._data.__getitem__(key)
15+
16+ def __setitem__(self, key, value):
17+ return self._data.__setitem__(key, value)
18+
19+ def __getattr__(self, key):
20+ return self._data.__getattribute__(key)
21+
22+ def __iter__(self):
23+ return self._data.__iter__()
24+
25+ def __repr__(self):
26+ return repr({ ' $ref' : self.ref} )
27+
28+ def __eq__(self, other):
29+ if isinstance(other, RefNode):
30+ return self._data == other._data and self.ref == other.ref
31+ elif six.PY2:
32+ return object.__eq__(other)
33+ elif six.PY3:
34+ return object.__eq__(self, other)
35+ else:
36+ return False
37+
38+ def __deepcopy__(self, memo):
39+ return RefNode(copy.deepcopy(self._data), self.ref)
40+
41+ def copy(self):
42+ return RefNode(self._data, self.ref)
943
1044{% include ' _do_not_change.tpl' %}
1145
You can’t perform that action at this time.
0 commit comments