Search code examples
hyperledgerhyperledger-composer

My POST body on composer-rest-server is incorrect


I have a function called getAllFieldsInInstitute with a model function

@returns(Field[])
transaction GetAllFieldsInInstitute{
  o String instituteId
}

I have a similar function called getAllEventTypesInInstitute with a model function:

@returns(EventType[])
transaction GetAllEventTypesInInstitute{
  o String instituteId
}

The script.js has the same logic file for both functions. Here are the POST body's for both functions:

This is the POST body for the second function

I have tested it for GetAllEventTypesInInstitute, and it works as expected.

This is the post body of the first function

It does not match for GetAllFieldsInInstitute, and does not work. What do I need to change?

Edit: Function body is correct on bluemix: function body on composer bluemix

I have downloaded the .bna file from bluemix and deployed that on localhost.


Solution

  • The post body on the browser is incorrect. If I copy the post body from composer-playground and post to the API, I get the correct response.