kristopolous / TickTick

JSON in your Bash scripts

Home Page:http://9ol.es/TheEmperorsNewClothes.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem when key contains period character

waltari2001 opened this issue · comments

It looks like the parser will throw errors on keys that contain '.'

Yes. Yes it will. This is known as the magic string antipattern (http://en.wikipedia.org/wiki/Magic_string) and unless I'm missing something, there's no trivial way around it.

To my understanding, the JSON that specifies "something.somethinglese" is okay as it is clearly identified that something and somethingelse are both part of the same key. Is quoting not a way around it? Or, am I missing something :)

Many thanks,

James

I'm thinking more about this. I could probably just have a reserved escape character, I probably won't need to obscure everything.

I'm going to expand this. I'm using http://www.json.org/ as a guide and also the node shell.

Inside of quotes I can do things like this:

> { ".'\":": true}
{ '.\'":': true }

That's an

  • escaped character
  • a colon
  • a period
  • a single quote

So I'm going to close this and open up a new bug that tries to address all these things