There are special use-cases that each language supports; this document pertains to JavaScript models.
- Rendering complete models to a specific module system
- Generate un/marshal functions for classes
- Generate example data function
In some cases you might need to render the complete models to a specific module system such as ESM and CJS.
Check out this example for a live demonstration how to generate the complete JavaScript models to use ESM module system.
Check out this example for a live demonstration how to generate the complete JavaScript models to use CJS module system.
Sometimes you want to use the models for data transfers, and while most cases would work out of the box, custom serializer functionality is needed for the advanced cases. If you generated the data models based on a JSON Schema document and you want the serialized data to validate against the schema, this functionality is REQUIRED.
Here, this can be done by including the preset JS_COMMON_PRESET
using the option marshalling
.
Check out this example out for a live demonstration.
Generate example instance of the data model including the preset JS_COMMON_PRESET
using the option example
.
Check out this example out for a live demonstration.