-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.5.0
-
Fix Version/s: 6.5.0
-
Component/s: API descriptor
-
Environment:ForgeRock Access Management 6.5.0-SNAPSHOT Build d76eb5f2ec (2018-August-03 10:10)
-
Target Version/s:
Bug description
API Explorer - Creating Secondary Data Store Configuration - Bad Request Error: "The request body must include '_id'."
How to reproduce the issue
Use the API Explorer to create a secondary data store configuration e.g.:
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ "serverHostname": "joanna.example.com", \ "serverPort": 2389, \ "bindDN": "cn=Directory Manager", \ "bindPassword": "cangetinam", \ "minimumConnectionPool": 1, \ "maximumConnectionPool": 1, \ "useSsl": true, \ "useStartTLS": true \ }' 'http://joanna.example.com:8080/openam/json/global-config/services/DataStoreService/config/blah'
Expected behaviour
Repsonse Code - 201:
{ "_id": "blah", "_rev": "-2006361176", "bindDN": "cn=Directory Manager", "maximumConnectionPool": 1, "serverHostname": "joanna.example.com", "bindPassword": null, "minimumConnectionPool": 1, "useStartTLS": true, "serverPort": 2389, "useSsl": true, "_type": { "_id": "config", "name": "Configuration Instance", "collection": true }
Current behaviour
{ "code": 400, "reason": "Bad Request", "message": "The request body must include '_id'." }
It is unusual to need the entity name in both the URL and json data
Work around
Add "_id": <data_store_name> to the json data