couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit Chesneau (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1306) Allow Booleans to be quoted in Rewrite rules
Date Sat, 15 Oct 2011 13:23:11 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128173#comment-13128173
] 

Benoit Chesneau commented on COUCHDB-1306:
------------------------------------------

I don't like the term "breaks". "don't work like I expect it should" is more accurate here.
Strings are perfectly valid in json. 

The reasoning to use strings here is to handle miscellaneous strings coming from the query
argument.

While using json in query params of the rewrites members is perfectly feasible, it's different
when you have to handle strings coming from the query:

- a params may be a string sometimes or an array in a view, or maybe just a string in a view
too :

eg:
?key=%5B1%2C2%5D

When you aren't rewriting a view. Should it be considered like [1,2] or "[1,2]" or ["1", "2"]
?

First implementations was considering that everything in the query was json values. It was
apparently a problem for some.

While I have some ideas to solve that, at some point using a format member to define the format
of a variable was the simplest and working way to solve that. That what does most of the rewriters
even with regexps anyway. (there is btw another implementation I posted on the ml that was
badly waiting for reviews ....).

I have some idea about the rewriter DSL anyway. Just need to connect the bits before posting
it.

                
> Allow Booleans to be quoted in Rewrite rules
> --------------------------------------------
>
>                 Key: COUCHDB-1306
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1306
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.1, 1.2
>            Reporter: Benjamin Young
>              Labels: couchapp, rewriter
>
> COUCHDB-1074 breaks the JSON format of Rewrite rules requiring that Boolean values always
be quoted. This requires additional knowledge for a user to even understand why their JSON
doesn't work with CouchDB.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message