your expectation is correct eg. a replay of a POST with same exact properties 
should not throw an error.

It could be that our internal conversion of your json to xml (cause we 
internally validate with xml schema) is getting hung up on json re-ordering 
properties in the sub element 'range-element-index' ... between 2 different 
POSTs it could appear different due to the properties going out of order. If 
that is the case then this would be a bug.

J



________________________________
From: [email protected] 
[[email protected]] on behalf of Florent Georges 
[[email protected]]
Sent: 31 January 2017 18:05
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] re Management API

Hi Jim,

Thank you for the tip.  What I posted was the output of logging the
object, which was sent from JavaScript (and properly serialized to the
HTTP request, indeed).

Here is a complete repro from the command line, using CURL (just adapt
the second line with your credentials, potentially the firt one as
well if you do not use DIGEST, and the last line if your dev MarkLogic
instance is not on localhost).

curl --digest \
    -uadmin:admin \
    -X POST \
    -H "Content-Type: application/json" \
    -d '
{ "database-name": "fgeorges-test",
  "range-element-index":
   [ { "scalar-type": "string",
       "localname": "foobar",
       "range-value-positions": false,
       "invalid-values": "ignore",
       "namespace-uri": "",
       "collation": "http://marklogic.com/collation/"; } ] }' \
    http://localhost:8002/manage/v2/databases

If you execute this command on a shell, it will create a database with
the name "fgeorges-test" (you can check it is OK on the admin console).
If you try to execute the same again, it returns the following error:

{"errorResponse": {
    "statusCode":"400",
    "status":"Bad Request",
    "messageCode":"MANAGE-CONFLICTINGCONFIG",
    "message":"MANAGE-CONFLICTINGCONFIG: (err:FOER0000) A conflict has been 
detected:  database configurations differ."}}

Is this really the expected behaviour?  Even though both requests are
exactly the same?

Regards,

--
Florent Georges
H2O Consulting
http://h2o.consulting/ - New website!


On 25 January 2017 at 18:11, Jim Fuller wrote:
as one of my colleagues reminded me I meant 'quotes'

J
________________________________
From: Jim Fuller
Sent: 25 January 2017 17:05
To: [email protected]<mailto:[email protected]>
Subject: re Management API

Hello Florent,

The json you supplied seems to be missing some single quotes in places.

Could you check you have well formed json and retry ?

thx, Jim Fuller




_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general

--
Florent Georges
<http://developer.marklogic.com/mailman/listinfo/general>http://fgeorges.org/
http://h2o.consulting/ - New website!
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to