Class: ODataMockGenerator

ODataMockGenerator(metadata, optionsopt)

OData Mock Data Generator

Constructor

new ODataMockGenerator(metadata, optionsopt)

Parameters:
Name Type Attributes Default Description
metadata string OData metadata XML
options Object <optional>
{} Generation options and rules
Properties
Name Type Attributes Default Description
defaultLengthOfEntitySets number <optional>
30 Number of entities to generate for each entity set
mockDataRootURI string <optional>
"" Root URI which prefixes __metadata.uri property in the generated entities
rules Object <optional>
{} Additional rules
Properties
Name Type Attributes Default Description
skipMockGeneration Array.<string> <optional>
[] Do not generate data for the given entity sets
distinctValues Array.<string> <optional>
[] Generate only distinct entries (based on the key properties) for the given entity sets
predefined Object <optional>
{} Predefined values for the given entities, see README
variables Object <optional>
{} Variables to use in "predefined" rules, see README
faker Object <optional>
{} Faker.js methods used to generate data for given properties, see README
lengthOf Object <optional>
{} Number of entities to generate for given entity sets, see README
Source:

Classes

ODataMockGenerator

Methods

createMockData() → {Object}

Generates mock data based on the metadata and options passed to the constructor
Source:
Returns:
Generated data in form { EntitySet1: [{ ..properties.. }], EntitySet2: [{ .. properties.. }] }
Type
Object