It's common to have json pointers including a / in a segment in OpenAPI, because OpenAPI uses both paths and content types as keys.
/ is escaped as ~1 in Json Pointer - so for instance in the json pointer /paths/~1users/post/requestBody/application~1json/schema the unescaped segments are paths, /users, post, requestBody, application/json and schema.
It is not possible to construct a SchemaLocation from this valid json pointer.
It's because JsonNodePath.toString() calls PathType.JSON_POINTER.append(String currentPath, String child) which assumes child is unescaped and escapes it.
It's common to have json pointers including a
/
in a segment in OpenAPI, because OpenAPI uses both paths and content types as keys./
is escaped as~1
in Json Pointer - so for instance in the json pointer/paths/~1users/post/requestBody/application~1json/schema
the unescaped segments arepaths
,/users
,post
,requestBody
,application/json
andschema
.It is not possible to construct a SchemaLocation from this valid json pointer.
The following test fails:
Because the following test fails: