Skip to main content

29 posts tagged with "Node.js"

View All Tags

· One min read

Usage of discriminators is already supported by our code generation engine. We are happy to announce that now support for using discriminators has also been added to Node.

  • Discriminator is a field that is used to differentiate between a parent model and models that inherit from it.
  • The response is deserialized into the parent model or one of its child classes by inspecting the discriminator field's value in the response.
  • Using a discriminator field, you can build leaner models by not having to build unions of fields needed by a polymorphic response.

Please generate your SDK again if you want to use this feature.

· One min read

We've made an improvement to how model properties are now generated in the code. The generated SDK now contains both camel case-d version of the property name and the actual property name (where applicable).
Read on to find more details about the change.

Please generate your SDK again to get the improved code.

· 2 min read

NodeJS SDKs will now return promises in endpoint calls, as an alternative to accepting callbacks.

  • We use ES6 Promises which is based on Promises/A+ and is interoperable with most Promise-based implementations.
  • Callbacks are still supported (for backward-compatibility) but are now optional.

Re-generate your NodeJS SDK to get the new Promise-enabled SDK implementation now.

· 3 min read

We have changed the structure of the SDK to break cyclic dependencies. Due to this, the following changes have been made:

  • Model deserialization logic has moved out from model classes.
  • We have added new files ObjectMapper.js and ModelFactory.js to the sdk.
  • Exception handling in BaseController has changed to use ObjectMapper.
  • BaseModel is now being used to assign values to model properties (when model class is directly instantiated)
  • BaseController is not being exposed by the API Client now.

Please generate your SDK again to get the improved code.

· 3 min read

Keeping with our tradition of Continuous Improvement, we are proud to announce a major revamp of NodeJS SDKs!

  • Our code now conforms with Airbnb's JavaScript Style Guide.
  • We are using ES6 classes, along with other ES6 primitives.
  • You can run npm run lint to lint your code immediately.
  • We generate CI/CD files for Travis, CircleCi, Appveyor and Jenkins to run NodeJS tests.

Please generate your SDK again if you want the improved ES6 based code.

· 2 min read

Multiple bugs were identified and fixed for Node SDK. A summary of all bugs is given below with some details about each:

  • There was a bug in printing multi-line string literals in controller files.
  • In Controller files, string encoding for headers had some issues.
  • Exception Class imports within Controllers were printed with invalid exception class names.
  • Moment.js (for Date/Datetime) import statement was not being handled properly.
  • Imports for Server.js and Environment.js file in index.js will now only be included if multiple base urls are specified in the API description.
  • Exception Class files' constructor function code has improved.
  • API Exception's constructor function code has improved.
  • Models or model properties which are being used in endpoints (such as parameters) are now being imported properly in the Controllers. Transitive imports are handled as well (if one model requires another, both are included in the controller).
  • Custom Type imports in model files have also been fixed now. If a custom type inherits from another custom type or contains an object of another custom type, that custom type is included in the model file. This import logic has been fixed.
  • Code in the Request Client file was not generating properly for Superagent client. Code for retries was being added even through retries were not enabled. This bug has been fixed.

All the above mentioned bugs have been fixed. We recommend generating Node SDK again to get all these bug fixes and minor code improvements.

· One min read

There was a bug in the index file of the generated SDK. The import for configuration.js was not handled correctly. This bug was causing trouble in using the properties and functions exported from configuration.js.

You may generate your SDK again to get this bug fix.