JSON Export mapping missing few attributes while calling REST service

0
I have 4 attributes in the JSON structure and out of them any one is mandatory but for REST service all 4 attributes should be send.  But in my case only specified attributes are part of request message to the API. The minimum occurrence is default set to 0 in export mapping properties which I am not able to change also my entities are non persistent.   required schema to be sent {"name": "", "college": "", "department": "", "include_transactions": false} as is scenario  {"department": "test", "include_transactions": false} (missed the name and college from the request message )
asked
3 answers
1

The problem is not in the JSON structure, but in the export mapping.

You should set Send empty values to false in your export mapping.

See https://docs.mendix.com/refguide/mapping-documents

answered
0

On what is the export mapping based? JSON or XML? Because you could adjust the XSD or JSON. Based on that information the modeler decides if the attribute is optional or nillable.

Regards,

Ronald

[EDIT]

If optional is false it means that the attribute should always be in the message. Nillable means that the value could be empty. So in your case occurance should be 1 and nillable set to true. If occurance is not one double check the JSON to see if every attribute is always present even if the value is empty. 

answered
0

answered