{"id":16003016,"url":"https://github.com/mauriciolauffer/openui5-validator","last_synced_at":"2025-03-17T16:30:22.760Z","repository":{"id":23958519,"uuid":"100255632","full_name":"mauriciolauffer/openui5-validator","owner":"mauriciolauffer","description":"A library to validate OpenUI5 fields","archived":false,"fork":false,"pushed_at":"2023-12-05T23:56:49.000Z","size":1268,"stargazers_count":18,"open_issues_count":1,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T01:21:51.582Z","etag":null,"topics":["ajv","javascript","json-schema","openui5","openui5-framework","openui5-validator","plugin","sap","sapui5","ui5","validation","validator"],"latest_commit_sha":null,"homepage":"https://mauriciolauffer.github.io/openui5-validator/demo/webapp/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauriciolauffer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"mauriciolauffer"}},"created_at":"2017-08-14T10:24:28.000Z","updated_at":"2024-05-23T12:46:41.000Z","dependencies_parsed_at":"2024-10-27T15:18:26.880Z","dependency_job_id":"d9649a2c-5b9e-46d3-a9d3-5492c7c775d7","html_url":"https://github.com/mauriciolauffer/openui5-validator","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fopenui5-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fopenui5-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fopenui5-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fopenui5-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauriciolauffer","download_url":"https://codeload.github.com/mauriciolauffer/openui5-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243870980,"owners_count":20361285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajv","javascript","json-schema","openui5","openui5-framework","openui5-validator","plugin","sap","sapui5","ui5","validation","validator"],"created_at":"2024-10-08T10:05:44.221Z","updated_at":"2025-03-17T16:30:22.074Z","avatar_url":"https://github.com/mauriciolauffer.png","language":"JavaScript","funding_links":["https://github.com/sponsors/mauriciolauffer"],"categories":[],"sub_categories":[],"readme":"# openui5-validator\n\n[![npm](https://img.shields.io/npm/v/openui5-validator)](https://www.npmjs.com/package/openui5-validator) [![test](https://github.com/mauriciolauffer/openui5-validator/actions/workflows/test.yml/badge.svg)](https://github.com/mauriciolauffer/openui5-validator/actions/workflows/test.yml)\n\nAn OpenUI5 library to validate fields.\n\nThis library uses Ajv, a JSON schema validator. All validation keywords available in Ajv can be used.\n\n## JSON Schema and Ajv\n\nFor any references, please follow\n\n* [JSON schema specification](http://json-schema.org/)\n* [Ajv documentation](https://github.com/epoberezkin/ajv)\n\nAjv Options: \u003chttps://github.com/epoberezkin/ajv#options\u003e\n\nAjv Keywords: \u003chttps://github.com/epoberezkin/ajv#validation-keywords\u003e\n\n## Demo\n\nYou can check out a live demo here:\n\n\u003chttps://mauriciolauffer.github.io/openui5-validator/demo/webapp/index.html\u003e\n\n![Demo Screenshot](./openui5-validator.png)\n\n## Project Structure\n\n* demo - Library's live demo\n* dist - Distribution folder which contains the library ready to use\n* src  - Development folder\n* test - Testing framework for the library\n\n## Getting started\n\n### Installation\n\nInstall openui5-validator as an npm module\n\n```sh\n$ npm install openui5-validator\n```\n\n### Configure manifest.json\n\nAdd the library to *sap.ui5/dependencies/libs* and set its path in *sap.ui5/resourceRoots* in your manifest.json file, as follows:\n\n```json\n{\n  \"sap.ui5\": {\n    \"dependencies\": {\n      \"libs\": {\n        \"openui5.validator\": {}\n      }\n    },\n    \"resourceRoots\": {\n      \"openui5.validator\": \"./FOLDER_WHERE_YOU_PLACED_THE_LIBRARY/openui5/validator/\"\n    }\n  }\n}\n```\n\n### How to use\n\nImport openui5-validator to your UI5 controller using *sap.ui.require*:\n\n```javascript\nsap.ui.require([\n  'openui5/validator/Validator'\n], function (Validator) {\n  const validationSchema = {\n    properties: {\n      email: { //UI5 control ID\n        type: 'string',\n        format: 'email',\n        minLength: 3 //required\n      },\n      salary: { //UI5 control ID\n        type: 'number',\n        minimum: 0,\n        maximum: 9999999\n      },\n      birthdate: { //UI5 control ID\n        format: 'date'\n      }\n    }\n  };\n\n  const validator = new Validator(this.getView(), validationSchema);\n  if (validator.validate()) {\n    console.log('Valid!');\n  } else {\n    console.log('Invalid! Errors...');\n    console.dir(validator.getErrors());\n  }\n});\n```\n\n## Config Parameters\n\n| Name | Type | Default| Description\n| :---- | :------------------- | :---- | :---------  |\n| view | sap.ui.core.mvc.View | null | UI5 view which contains the fields to be validated.\n| schema | object | null | JSON schema used for validation\n| opt | object | null | Parameters to initialize Ajv\n\n## Author\n\nMauricio Lauffer\n\n* LinkedIn: [https://www.linkedin.com/in/mauriciolauffer](https://www.linkedin.com/in/mauriciolauffer)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauriciolauffer%2Fopenui5-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauriciolauffer%2Fopenui5-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauriciolauffer%2Fopenui5-validator/lists"}