IDE extensionIDE extensiontypeInstalls into a development environment (VS Code, Eclipse with ABAP Development Tools, SAP Business Application Studio) and works inside it, rather than as a library you call or a command you run.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

vscode-ui5-odata-mock-generator

VS Code extension that generates JSON mock data files for an OData service from its metadata, with faker.js values, per-set sizes, value lists and values tied to other properties.

Reads the service metadata XML, by default webapp/localService/metadata.xml in the project or the URL or file named by metadataPath, and writes JSON mock data files to webapp/localService/mockdata, 30 entries each unless defaultLengthOfEntitySets says otherwise. Values come from faker.js methods, from sets of values you supply, or from the value of another property, which is how navigations between entity sets are made to match; entity sets can be skipped, given their own size and forced to distinct key values. The generation itself is done by the OData Mock Generator library, which its README says is based on OpenUI5 Mock Server. The README names no OData version.

Facts

Latestv1.1.7ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
UI5 testingUI5UI5 testingcapabilityProving a UI still works — unit tests over controllers and formatters, integration tests that drive real controls, and end-to-end runs against a served app.

Who is behind it

Jacek WozniczakJacek WozniczakPersonMaintains this
In the atlas: maintains 3, contributes to 4
@wozjac
maintainer

What it declares

Every artifact

Type
IDE extension
Origin
Independently maintained

As an IDE extension

Installs into
VS Code
Distributed through
Visual Studio Marketplace

Connections1

Install

npm add vscode-ui5-odata-mock-generator

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from wozjac/vscode-ui5-odata-mock-generator under MIT, read
wozjac/vscode-ui5-odata-mock-generator/README.mdOn GitHub

Build Status Coverage Status

VSCode UI5: OData Mock Generator

From version 1.0.1 - please migrate the settings to the ones prefixed with "Odata Mock Generator". The old ones will be removed in the next version.

VSCode extension - an OData mock data files generator on steroids.
Generates JSON mock data files based on the provided OData metadata. Uses OData Mock Generator under the hood, which is based on OpenUI5 Mock Server

Please check the sample use case here: https://jacekw.dev/blog/sdn/enhanced-odata-mocks-ui5

Features

  • use faker.js API methods for data generation
  • generate specific number of entities for given entity sets
  • skip generation of Entity Sets you don't need
  • provide sets of values, which should be used instead of pure random values
  • more meaningful and related data - values from one property can have a specific value based on a value from another property, which helps with building navigations
  • force to have only distinct entries within an Entity Set (based on key properties)

Installation

Search & install the extension via VSCode Extensions.

How it works

After installation a new command is available: mock files

By default, the generator will look for a service metadata XML file in the project's root path webapp/ localService/metadata.xml and create mock data files in the webapp/localService/mockdata folder. The path can be changed with the setting metadataPath. It can also be a URL to metadata, for example, https://services.odata.org/V3/OData/OData.svc/$metadata. The path for mock data files is set via mockDataTargetDirectory.

For the Northwind test service: mock files

By default each file has 30 entries (this is adjustable by the setting defaultLengthOfEntitySets) and new files will overwrite old ones (change this with overwriteExistingMockFiles). The length of data set can be also adjusted per entity set by using using .rules.json file (explained later).

The default root URI is an empty string, it can be changed by setting mockDataRootURI: "myURI".

Configure mock data generation

Additional options influencing data generation can be specified in .rules.json file. This file is by default searched in the project root, but it can be changed using setting mockRulesConfigFilePath. The JSON provided in this file corresponds to the rules property.

Below examples are based on the metadata from https://sapes5.sapdevcenter.com/sap/opu/odata/sap/ZSOCDS_SRV

Skipping mock data generation for entity sets

If you don't want to generate files for given entity sets, because we prefer to have our own ones, then by using "skipMockGeneration": [EntitySetName1,EntitySetName2] mock data generation will be skipped for them.

For example:

{
  "skipMockGeneration": ["SEPM_I_SalesOrderItem_E"]
}
Setting number of generated entities

defaultLengthOfEntitySets settings sets the default number of generated entries; this can be overwritten for a specific entity sets using rules.lengthOf option.

Setting generation of 2 entries for Products, 12 for Categories:

{
  lengthOf: {
    Products: 2,
    Categories: 12
  }
}
Using faker.js

Faker.js API methods can be provided and they will be used instead of default logic for data generation. Alternatively, Mustache-like string with several values can be also passed as described in the faker.js docs, for example {{person.lastName}}, {{person.firstName}} {{person.suffix}}. If the string property has *MaxLength" attribute, generated value will be limited accordingly.

{
  "faker": {
    "Entity": {
      "Property1": "faker.method",
      "Property2": "{{faker.method}}, {{faker.method}}"
    }
  }
}

For example:

{
  "faker": {
    "Product": {
      "Name": "commerce.productName",
      "Description": "{{lorem.paragraph}}, {{commerce.productDescription}}"
    }
  }
}
Predefined values

If for some entities values should be randomly selected BUT from predefined set of values, then it can be configured in the following way:

{
  "predefined": {
    "Entity": {
      "Property": [Value1, Value2, Value3]
    }
  }
}

For example:

{
  "predefined": {
    "SEPM_I_SalesOrder_EType": {
      "ID": ["myID1", "myID2", "myID3"]
    }
  }
}
Predefined values based on other values

For some values it make sense to make them dependent on other values. This can be achieved in the following way:

{
  "predefined": {
    "Entity": {
      "Property1": [Value1, Value2, Value2],
      "Property2": {
        "reference": "Property1",
        "values": [{
          "key": Value1,
          "value": "Description for value 1"
        },{
          "key": Value2,
          "value": "Description for value 2"
        }]
      }
    }
  }
}

Not all dependent values have to be provided; if a value is not found in the values array, it will be generated as usual.

For example we want to have valid set of IDs in

{
  "predefined": {
    "SEPM_I_SalesOrder_EType": {
      "ID": ["myID1", "myID2", "myID3"],
      "SalesOrder_Text": {
        "reference": "ID",
        "values": [{
          "key": "myID1",
          "value": "Custom text for myID1"
         }, {
           "key": "myID2",
           "value": "Another custom text for myID2"
        }]
      }
    }
  }
}
Re-using predefined values

It is easier to keep predefined values in one place, as they might be used in several places. It can be done with help of special variables property and special $ref:... handling:

{
  "variables": {
    "myValues": [value1, value2, value3]
  },
  "predefined": {
    "Entity": {
      "Property1": "$ref:myValues",
      "Property2": {
        "reference": "Property1",
        "values": [{
          "key": "value1",
          "value": "Text1"
        }, {
          "key": "value2",
          "value": "Text2"
        }]
      }
    }
  }
}

For example:

{
  "variables": {
    "salesOrderIDs": ["myID1", "myID2", "myID3"]
  },
  "predefined": {
    "SEPM_I_SalesOrder_EType": {
      "ID": "$ref:salesOrderIDs",
      "Name": {
        "reference": "ID",
        "values": [{
          "key": "myID1",
          "value": "Custom text for myID1"
        }, {
          "key": "myID2",
          "value": "Another custom text for myID2"
        }]
      }
    }
  }
}
Distinct values

Having predefined values for entities and their key properties, duplicated entries will be present, as the generator always produces the number of entries specified by the defaultLengthOfEntitySets or lengthOf: {... property from .rules.json. To have only distinct values (based on all key properties):

{
    "variables": [...]
    "distinctValues": ["EnitytSet1", "EntitySet2"]
    ...
}
Sample .rules.json file

Sample .rules.json file with all features, based on https://services.odata.org/V3/Northwind/Northwind.svc/$metadata

{
  "skipMockGeneration": ["Summary_of_Sales_by_Quarters", "Summary_of_Sales_by_Years"],
  "variables": {
    "categoryIDs": [1, 2, 3]
  },
  "distinctValues": ["Categories"],
  "faker": {
    "Employee": {
      "City": "address.city"
    }
  },
  "lengthOf": {
    "Order_Details_Extendeds": 10
  },
  "predefined": {
    "Category": {
      "CategoryID": "$ref:categoryIDs",
      "CategoryName": {
        "reference": "CategoryID",
        "values": [{
          "key": 1,
          "value": "Custom text for ID 1"
        }, {
          "key": 2,
          "value": "Another custom text for ID 2"
        }]
      }
    }
  }
}

Extension Settings

This extension contributes the following settings:

  • metadataPath: the path to the OData service - URL or file path (relative to the project root). Default is webapp/localService/metadata.xml
  • mockDataRootURI: the root URI for mock data entries. Default is "".
  • mockDataTargetDirectory: the target directory for generated mock data files. Default is webapp/localService/mockdata
  • defaultLengthOfEntitySets: default length of data set for each entity set. Default value is 30. It can be overridden in .rules.json
  • overwriteExistingMockFiles: overwrite existing files in the mock data target directory? Default is true.
  • mockRulesConfigFilePath: where .rules.json file should be searched for

Release Notes

See CHANGELOG.md

License

This plugin is licensed under the MIT license.

Author

Feel free to contact me:

Icon based on a one from https://www.freepik.com / https://www.flaticon.com/

MIT, read

History

Latest

v1.1.7

  1. v1.1.6

  2. v1.1.5

    Fixes 1

    Notes
    Bug Fixes
    • add missing dependency to omg (b926282)
  3. v1.1.4

  4. v1.1.3

  5. v1.1.2

  6. v1.1.1

  7. v1.1.0

    Features 1

    Notes
    Features
    • mark old config settings as deprecated (0c226b4)
  8. v1.0.1

  9. v1.0.0

3downloads per week, npm
Weekly downloads for vscode-ui5-odata-mock-generator26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 3.27 Apr – 3 May: 94 May – 10 May: 2111 May – 17 May: 1818 May – 24 May: 1425 May – 31 May: 101 Jun – 7 Jun: 108 Jun – 14 Jun: 715 Jun – 21 Jun: 2122 Jun – 28 Jun: 1929 Jun – 5 Jul: 336 Jul – 12 Jul: 1613 Jul – 19 Jul: 1020 Jul – 26 Jul: 2127 Jul – 2 Aug: 143 Aug – 9 Aug: 3710 Aug – 16 Aug: 2317 Aug – 23 Aug: 1024 Aug – 30 Aug: 1531 Aug – 6 Sept: 77 Sept – 13 Sept: 1414 Sept – 20 Sept: 4521 Sept – 27 Sept: 3428 Sept – 4 Oct: 395 Oct – 11 Oct: 812 Oct – 18 Oct: 319 Oct – 25 Oct: 3
UI5 testing
  1. ui5-test-runnerCommand line running UI5 QUnit and OPA tests in parallelfrom UI5
  2. ui5-middleware-odata-recorderUI5 middleware recording OData traffic as mock server datasetsfrom UI5
  3. jest-environment-ui5Jest environment running UI5 unit tests in Node.jsfrom UI5
  4. openui5-smart-mockserverUI5 MockServer extension generating mock data with Faker.jsfrom UI5
  5. vitest-environment-ui5Vitest environment running UI5 unit tests in Node.jsfrom UI5
  6. wdio-qunit-serviceWebdriverIO service running QUnit test pagesfrom UI5
  7. @openui5/sap.ui.coreFramework core: module loader, MVC runtime, binding, routing, themingfrom UI5
  8. karma-ui5-transpileKarma preprocessor transpiling UI5 sources via ui5-tooling-transpilefrom UI5
  9. ui5-journey-recorderChrome extension generating OPA5 or wdi5 tests from recorded journeysfrom UI5
  10. wdi5-cucumberwdi5 plugin for Cucumber-style BDD tests on Fiori Elements appsfrom UI5
  11. wdi5-fe-selectorswdi5 selectors for locating controls in Fiori Elements appsfrom UI5
  12. wdio-ui5-serviceEnd-to-end testing for UI5 on WebdriverIO with UI5 control selectorsfrom UI5
  13. @ui5/middleware-code-coverageUI5 CLI middleware for Istanbul code coveragefrom UI5

Details

Sources4
Added by handdiscovered herechecked
npm registry, vscode-ui5-odata-mock-generatorversion, releases, installschecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
latestv1.1.7
first release
releases and cadence6, ~116d median
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainui5, developer-experience
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:wozjac-vscode-ui5-odata-mock-generator
JSON
/artifacts/wozjac-vscode-ui5-odata-mock-generator.json
MCP
Connecting an agent