Rest API for process instantiation - contract mismatch gives 500 instead of 400 like docs

According to Docs should get code 400 and explanations when sending wrong contract but instead I get 500. Why?

Log has messages
2015-11-17 08:24:37.117 -0500 org.bonitasoft.web.rest.server.api.resource.CommonResource org.bonitasoft.web.rest.server.api.resource.CommonResource doCatch
SEVERE: USERNAME=walter.bates | org.bonitasoft.engine.core.process.instance.api.exceptions.SContractViolationException: Error while validating expected inputs: [Expected input [validationDataInput] is missing]
org.bonitasoft.engine.exception.RetrieveException: USERNAME=walter.bates | org.bonitasoft.engine.core.process.instance.api.exceptions.SContractViolationException: Error while validating expected inputs: [Expected input [validationDataInput] is missing]

Docs says I should get 400
http://documentation.bonitasoft.com/bpm-api-849#process

Request url POST |/API/bpm/process/8902137890939378455/instantiation
Request payload

{
“wrongElement”:“This is not the right contract element”
}
Response
400 Bad request
{
“exception”:“class org.bonitasoft.engine.bpm.contract.ContractViolationException”,
“message”:"USERNAME=walter.bates | Contract is not valid: ",
“explanations”:[
“Expected input [ticket_account] is missing”,
“Expected input [ticket_description] is missing”,
“Expected input [ticket_subject] is missing”
]
}

1 Like

I think that this is a bug and I suggest that you open an issue on the community bug tracker .

thanks. I upgraded from 7.1 to 7.1.3 same issue so filed

https://bonita.atlassian.net/browse/BBPMC-336