You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "glen (JIRA)" <ji...@apache.org> on 2017/07/07 17:10:00 UTC
[jira] [Commented] (COUCHDB-3431) 400 error when posting valid JSON
[ https://issues.apache.org/jira/browse/COUCHDB-3431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078393#comment-16078393 ]
glen commented on COUCHDB-3431:
-------------------------------
You changed the input to prevent Couch from failing. You wrapped the array in an object, which is a reverse of the problem, and your conclusion is therefore rash and misleading. Try instead submitting the JSON that causes an error:
curl -X PUT localhost:15984/foo/bar2 -d '[{}]'
Wrapping an object in an array is valid JSON. See here an example from IETF:
["vcalendar",
[ /* Add jCal properties in place of this comment */ ],
[ /* Add jCal components in place of this comment */ ]
]
Source - https://tools.ietf.org/html/rfc7265#page-4
> 400 error when posting valid JSON
> ---------------------------------
>
> Key: COUCHDB-3431
> URL: https://issues.apache.org/jira/browse/COUCHDB-3431
> Project: CouchDB
> Issue Type: Bug
> Affects Versions: 2.0.0
> Reporter: glen
>
> Is anything invalid about the first member of an array being an empty object?
> Please post [{}] to your Couch. Does your Couch return invalid json 400 error, or is it just me?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)