Dorthu / openapi3

A Python3 OpenAPI 3 Spec Parser
BSD 3-Clause "New" or "Revised" License
118 stars 47 forks source link

Doesn't resolve JSON path escape codes #74

Closed smurfix closed 2 years ago

smurfix commented 2 years ago

RFC 6901 says that ~1 must be de-escaped to / and ~0 is de-escaped to ~ (in this order).

smurfix commented 2 years ago
(Pdb) l
103             for part in path:
104                 if isinstance(node, Map):
105                     if part not in node:  # pylint: disable=unsupported-membership-test
106                         err_msg = "Invalid path {} in Reference".format(path)
107                         breakpoint()
108  ->                     raise ReferenceResolutionError(err_msg)
109                     node = node.get(part)
110                 else:
111                     if not hasattr(node, part):
112                         err_msg = "Invalid path {} in Reference".format(path)
113                         raise ReferenceResolutionError(err_msg)
(Pdb) p part
'~1phone~1call_logs'
(Pdb) p node