NodeJS SDKs can now optionally preserve additional properties returned in the response. This setting can be enabled via Settings > CodeGen Settings page in the API editor and turning on the Enable Additional Model Properties flag.
Details
- A property
additionalPropertiesand a functionaddAdditionalPropertyhave been added to model classes to store additional model properties. additionalPropertieswhich has been added to model classes is an associative array. It stores key-value pairs in an array.- The
toJSONfunction in model classes now includes additional model properties in the serialized model that it returns. When called, it will return all addtional properties added to the model as individual properties. Array of additional properties will not be returned. ObjectMapperclass has functionality added to cater for additional properties when mapping model properties.- A flag (function parameter) has been added to
mapObjectfunction ofObjectMapperclass due to which controllers' call tomapObjecthas been updated as well.
This feature is now supported in all language SDKs except AngularJS and Go.