Closed sudo-tilakvardhan closed 3 years ago
Is this while the contract is in "DRAFT" mode?
If yes, then its an expected result.
RAW will only be available after "SENT"/"RECEIVED"
Yes first this was tested in DRAFT mode.
But Two additional observation: 1.) Even if I get a contract in raw which is of SENT mode, I get 500 error code with response Cannot read property 'name' of undefined 2.) If RAW isn't supported in DRAFT mode, we need to update the error msg when a user request in any other format. Current msg is : "message": "request.query.format should be equal to one of the allowed values: JSON, RAW"
1) "name" is probably a bug that need fixing. "name" was removed from the code from the other requirements. we might have missed out somewhere.
2) eventually yes, once we finished focus on the Main Positive used case. currently we are focus on delivering the main usecase. these can be put into a "list" of to do in future for a cleaner setup.
I agree with Kong. After a quick verification on the return mapping, no name should be returned in RAW format.
This error "message": "request.query.format should be equal to one of the allowed values: JSON, RAW" is delivered during API schema validation of the incoming request ( the allowed values are only JSON or RAW ). This request is rejected because it does not satisfy the API interface. This request will never be acceptable. And if this error happened on the UI, the UI source code should be modified. But the error with internalErrorCode 2002 is an error for an incompatibility between a request and the actual state of the contract object. This request is well formated, and will be acceptable when the contract object will be in a compatible state. The meaning of these 2 errors is not really the same.
Closing as it works after updating the common-adapter to latest version.
While testing "get contracts by id" endpoint and hitting {{baseUrl}}/contracts/:contractId?format=RAW
I get http response 422 with following message
{ "internalErrorCode": 2002, "message": "Unvailable RAW format", "description": "The RAW format of this contract is unavailable." }
This works as expected when requesting JSON format