Closed fyang1024 closed 4 years ago
I've defined an object property in response schema as below:
taxes: { type: 'string', additionalProperties: { type: 'number' } }
The JS object property value in response data is like
taxes: { stampDuty: 0.12 }
Expected data in response:
"taxes": { "stampDuty": 0.12 }
Actual data in response:
"taxes": "[object Object]"
That's expected behavior, since you've defined taxes as string and pass an object. So object is serialized to string. If you need an object, you should pass proper type to taxes.
I've defined an object property in response schema as below:
The JS object property value in response data is like
Expected data in response:
Actual data in response: