PackagePackagetypeA library you install and call yourself.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 →

openui5-validator

An OpenUI5 library that validates the fields of a view against a JSON schema using Ajv, returning a verdict and a list of failures and leaving reporting to the user to the app.

Field checks in a UI5 view tend to be written control by control. openui5/validator/Validator takes the whole view and a JSON schema instead: new Validator(view, schema), then validate() returns the verdict and getErrors() lists the failures. Its checks are Ajv's, so every Ajv validation keyword can be used in the schema, and a third opt parameter passes initialisation options through to Ajv. The README documents no step that sets a value state or an error message on the controls; reporting back to the user is the application's. It is installed from npm and registered in the host app's manifest.

Facts

Latestv1.0.0ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
Data bindingUI5Data bindingcapabilityKeeping a control and a model in step in both directions, including the formatting, type conversion and validation that sit between the two.
Add-on to
@openui5/sap.ui.core@openui5/sap.ui.coreartifactThe OpenUI5 core: the module loader, the MVC runtime, data binding, routing, theming and the test stack, which is everything a UI5 app does before a single community package is added.
Requires
@openui5/sap.ui.core@openui5/sap.ui.coreartifactThe framework the library is built for: it validates the fields of a UI5 view and is loaded in a UI5 controller with sap.ui.require.AjvAjvoutside the atlasThe validation engine: the schema is evaluated by Ajv and the library passes its initialisation options through.

Who is behind it

Mauricio LaufferMauricio LaufferPersonMaintains this
In the atlas: maintains 16, contributes to 41, wrote 4
@mauriciolauffer
maintainer

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
does not say
Distributed through
npm

Connections3

Install

npm add openui5-validator

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

Where it sits in your app

Download
Your UI5 applicationdocumentedrequiresdocumentedrequiresAjv, systemAjvsystemopenui5-validator, moduleopenui5-validator@openui5/sap.ui.core, module@openui5/sap.ui.core
SAPnot SAP's, or the project's owndocumented only

README

quoted from mauriciolauffer/openui5-validator under MIT, read
mauriciolauffer/openui5-validator/README.mdOn GitHub

openui5-validator

npm test

An OpenUI5 library to validate fields.

This library uses Ajv, a JSON schema validator. All validation keywords available in Ajv can be used.

JSON Schema and Ajv

For any references, please follow

Ajv Options: https://github.com/epoberezkin/ajv#options

Ajv Keywords: https://github.com/epoberezkin/ajv#validation-keywords

Demo

You can check out a live demo here:

https://mauriciolauffer.github.io/openui5-validator/demo/webapp/index.html

Demo Screenshot

Project Structure

  • demo - Library's live demo
  • dist - Distribution folder which contains the library ready to use
  • src - Development folder
  • test - Testing framework for the library

Getting started

Installation

Install openui5-validator as an npm module

$ npm install openui5-validator
Configure manifest.json

Add the library to sap.ui5/dependencies/libs and set its path in sap.ui5/resourceRoots in your manifest.json file, as follows:

{
  "sap.ui5": {
    "dependencies": {
      "libs": {
        "openui5.validator": {}
      }
    },
    "resourceRoots": {
      "openui5.validator": "./FOLDER_WHERE_YOU_PLACED_THE_LIBRARY/openui5/validator/"
    }
  }
}
How to use

Import openui5-validator to your UI5 controller using sap.ui.require:

sap.ui.require([
  'openui5/validator/Validator'
], function (Validator) {
  const validationSchema = {
    properties: {
      email: { //UI5 control ID
        type: 'string',
        format: 'email',
        minLength: 3 //required
      },
      salary: { //UI5 control ID
        type: 'number',
        minimum: 0,
        maximum: 9999999
      },
      birthdate: { //UI5 control ID
        format: 'date'
      }
    }
  };

  const validator = new Validator(this.getView(), validationSchema);
  if (validator.validate()) {
    console.log('Valid!');
  } else {
    console.log('Invalid! Errors...');
    console.dir(validator.getErrors());
  }
});

Config Parameters

NameTypeDefaultDescription
viewsap.ui.core.mvc.ViewnullUI5 view which contains the fields to be validated.
schemaobjectnullJSON schema used for validation
optobjectnullParameters to initialize Ajv

Author

Mauricio Lauffer

License

This project is licensed under the MIT License - see the LICENSE file for details

MIT, read

History

Latest

v1.0.0

Breaking 1, Features 1, Fixes 3

Notes
⚠ BREAKING CHANGES
  • Use new sap.ui.core.Lib from v1.120.0
Features
  • Use new sap.ui.core.Lib from v1.120.0 (bf8b2e9)
Bug Fixes
1downloads per week, npm
Weekly downloads for openui5-validator26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 1.20 Apr – 26 Apr: 3527 Apr – 3 May: 274 May – 10 May: 4211 May – 17 May: 2418 May – 24 May: 3525 May – 31 May: 431 Jun – 7 Jun: 588 Jun – 14 Jun: 5015 Jun – 21 Jun: 2322 Jun – 28 Jun: 529 Jun – 5 Jul: 66 Jul – 12 Jul: 1413 Jul – 19 Jul: 020 Jul – 26 Jul: 2527 Jul – 2 Aug: 83 Aug – 9 Aug: 3910 Aug – 16 Aug: 2917 Aug – 23 Aug: 1124 Aug – 30 Aug: 1331 Aug – 6 Sept: 57 Sept – 13 Sept: 2814 Sept – 20 Sept: 2421 Sept – 27 Sept: 428 Sept – 4 Oct: 35 Oct – 11 Oct: 2212 Oct – 18 Oct: 1
Data binding
  1. ui5-antaresSAPUI5 library generating OData V2 metadata-based dialogs and pagesfrom UI5
  2. openui5-model-json-crudOpenUI5 JSONModel extension with CRUD over HTTPfrom UI5
  3. openui5-model-odata-v2-odatapromiseOpenUI5 OData V2 model extension with Promisesfrom UI5
  4. @openui5/sap.ui.coreFramework core: module loader, MVC runtime, binding, routing, themingfrom UI5

Details

Sources4
Added by handdiscovered herechecked
npm registry, openui5-validatorversion, releases, installschecked
github.com/git+https://github.com/mauriciolauffer/openui5-validator.gittree, pushes, contributors, CIchecked
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.0.0
first release
releases and cadence21, ~142d median
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainui5, ui-and-frontend-bridge
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:mauriciolauffer-openui5-validator
JSON
/artifacts/mauriciolauffer-openui5-validator.json
MCP
Connecting an agent