Escaping in JSON Pointers

Do you guys want to know how to refer to the /instances node under paths using a JSON pointer?

#/paths/~1instances

~1 is the escape sequence for /. And ~0 is the escape sequence for ~. I’m really learning more than I want to know.

Why ~ and not \, for example? Okay, maybe you don’t want to have a third escape sequence, \\ to denote \. But then, why not ~~ for ~ and ~/ for /?

I guarantee you, I will never be able to remember if ~1 is slash or tilde.

<~1rant>

Share

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply