[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14113744#comment-14113744
 ] 

Uwe Schindler commented on SOLR-6445:
-

This violates JSON standard: A string is a sequence of Unicode code points 
wrapped with quotation marks (U+0022).
See: [http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf]

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Bug
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14113800#comment-14113800
 ] 

Jack Krupansky commented on SOLR-6445:
--

+1 for violating the JSON standard! Okay, sure maybe we should have an option 
to require strict JSON, but it should default to false.

Could we support unquoted simple name values as well? Like:

{code}
{id: my-key}
{code}
 And if people strenuously object, maybe we just need to have a Solr JSON 
(SJSON or SON - Solr Object Notation) format with the relaxed rules.


 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Yonik Seeley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14113802#comment-14113802
 ] 

Yonik Seeley commented on SOLR-6445:


The latest version of noggit (v0.6) already supports single quoted and unquoted 
strings.
It's already in use in heliosearch.

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Noble Paul (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14113878#comment-14113878
 ] 

Noble Paul commented on SOLR-6445:
--

bq. This violates JSON standard: A string is a sequence of Unicode code points 
wrapped with quotation marks (U+0022).

yes it does. We leave the choice to the users. We don't have to be the guardian 
angels of 'json standard'

bq.The latest version of noggit (v0.6) already supports single quoted and 
unquoted strings.

Yes, I saw the code. But i need to set those flags explicitly , right?

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Yonik Seeley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14113898#comment-14113898
 ] 

Yonik Seeley commented on SOLR-6445:


Yes, you can set the flags explicitly, but the defaults are already more 
permissive.

And the JSON standard allows accepting more than JSON: 
http://www.ietf.org/rfc/rfc4627.txt
{quote}
   JSON parser MUST accept all texts that conform to the JSON grammar.
   A JSON parser MAY accept non-JSON forms or extensions.
{quote}

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14114053#comment-14114053
 ] 

Uwe Schindler commented on SOLR-6445:
-

Hi,
sorry I was not arguing against this change! I just wanted to mention that 
JSON has a spec. I strongly agree that keys should be free to use no quotes 
at all, because that is what you know from ECMA Script. ECMA Script also allows 
single quotes. If we allow that, of course single quotes must be escaped in 
input data.

Interestingly at the same time when [~noble.paul]'s issue was opened, in my 
mailbox the announcement for PHP 5.6 went in. Interestingly they do the 
opposite: Their parser json_decode was more flexible before, now its hardened 
to be more strict: http://php.net/releases/5_6_0.php (I don't know how many 
apps will break).

In any case, we may accept more relax JSON - I have no problem with that, _but 
when delivering JSON in the ResponseWriter we should be 100% according to spec 
(this includes also escaping forward slashes)._ Because the client may be a 
browser, and browsers only accept 100% valid JSON for security reasons if you 
parse with the official JSON API in newer browsers (if you use unsafe JSONP or 
eval() to parse, you should be killed).

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14114063#comment-14114063
 ] 

Uwe Schindler commented on SOLR-6445:
-

bq. Could we support unquoted simple name values as well?

I disagree. The proposal in this issue was to allow all Javascript syntax. 
But Javascript does not allow values to be without quotes. The reason is 
simple: You cannot guess the type from it (at least the javascript grammar 
cannot).

One thing: We should (if relaxing) also allow trailing commas, like:

{code:javascript}
{
  key1: value,
  key2: value, // -- here
}
{code}

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Noble Paul (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14114344#comment-14114344
 ] 

Noble Paul commented on SOLR-6445:
--

bq. but when delivering JSON in the ResponseWriter we should be 100% according 
to spec

absolutely. We should always emit fully compliant JSON

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul

 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6445) Allow flexible JSON input

2014-08-28 Thread Yonik Seeley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14114425#comment-14114425
 ] 

Yonik Seeley commented on SOLR-6445:


We should replace the noggit0.5 jar with this [attachment]
We don't check in jars any more... I think all that needs to be done to upgrade 
noggit is this?
https://github.com/Heliosearch/heliosearch/commit/06e9392

 Allow flexible JSON input 
 --

 Key: SOLR-6445
 URL: https://issues.apache.org/jira/browse/SOLR-6445
 Project: Solr
  Issue Type: Improvement
Reporter: Noble Paul
Assignee: Noble Paul
 Attachments: noggit-0.6.jar


 Support single quotes and unquoted keys
 {code:javascript}
 //all the following must be valid and equivalent
 {id :mykey}
 {'id':'mykey'}
 {id: mykey}
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org