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

1
+1
-1

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"
]
}

Comments

Submitted by drew.haller on Tue, 11/17/2015 - 19:08

thanks. I upgraded from 7.1 to 7.1.3 same issue so filed
https://bonita.atlassian.net/browse/BBPMC-336

1 answer

1
+1
-1
This one is the BEST answer!

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

<!-- Links -->
[community bug tracker]: https://bonita.atlassian.net/

Notifications