Docs
Options

Options

datagen can be configured using the options object inside the schema. The following options are available:

OptionDescriptionDefault
pluginsThe plugins to use.[]
maxRefCacheSizeThe maximum number of references to cache.
Lowering this value will increase the performance of the tool.
unlimited
serializeNonStringsWhether to serialize non-string values. Can be overridden by property values.false
serializerThe serializer to use.json

Serializer

The serializer is responsible for serializing the generated data to a string. The following serializers are available:

  • json (default)
  • yaml
  • xml
  • plugin (see plugins)

Serializer Options

JSON

OptionDescriptionDefault
prettyWhether to pretty print the JSON.false

YAML

This serializer has no options.

XML

OptionDescriptionDefault
rootElementThe name of the root element.unset, must be set by the user

Plugin

OptionDescriptionDefault
pluginNameThe name of the plugin to use.unset, must be set by the user
argsThe options to pass to the plugin.null

Example

{
  "options": {
    "plugins": [
      {
        "name": "my-plugin",
        "args": {
          "foo": "bar"
        }
      }
    ],
    "maxRefCacheSize": 100,
    "serializeNonStrings": true,
    "serializer": {
      "type": "json",
      "pretty": true
    }
  },
  "type": "string",
  "value": "Hello World!"
}