{"id":16003129,"url":"https://github.com/mauriciolauffer/sap-cap-validator-plugin","last_synced_at":"2025-07-09T20:08:04.923Z","repository":{"id":217094706,"uuid":"740274173","full_name":"mauriciolauffer/sap-cap-validator-plugin","owner":"mauriciolauffer","description":"SAP CAP plugin to validate incoming API requests.","archived":false,"fork":false,"pushed_at":"2024-04-01T02:52:36.000Z","size":368,"stargazers_count":10,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-29T20:16:14.678Z","etag":null,"topics":["cap","cap-js","cds","cds-plugin","nodejs","plugin","sap","sap-cap","validation","validator"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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":null,"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":"2024-01-08T02:06:38.000Z","updated_at":"2024-12-17T20:51:22.000Z","dependencies_parsed_at":"2024-01-26T13:09:00.795Z","dependency_job_id":"cae580f1-4001-4817-bcbd-3f6c13e00b17","html_url":"https://github.com/mauriciolauffer/sap-cap-validator-plugin","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"c81420a62eff2724d9db9f312ea2ccedc9b97e62"},"previous_names":["mauriciolauffer/sap-cap-validator-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mauriciolauffer/sap-cap-validator-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fsap-cap-validator-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fsap-cap-validator-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fsap-cap-validator-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fsap-cap-validator-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauriciolauffer","download_url":"https://codeload.github.com/mauriciolauffer/sap-cap-validator-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fsap-cap-validator-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263417497,"owners_count":23463316,"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":["cap","cap-js","cds","cds-plugin","nodejs","plugin","sap","sap-cap","validation","validator"],"created_at":"2024-10-08T10:06:26.535Z","updated_at":"2025-07-09T20:08:04.904Z","avatar_url":"https://github.com/mauriciolauffer.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mauriciolauffer"],"categories":[],"sub_categories":[],"readme":"# SAP CAP Validator Plugin\n\n[![npm](https://img.shields.io/npm/v/sap-cap-validator-plugin)](https://www.npmjs.com/package/sap-cap-validator-plugin) [![test](https://github.com/mauriciolauffer/sap-cap-validator-plugin/actions/workflows/test.yml/badge.svg)](https://github.com/mauriciolauffer/sap-cap-validator-plugin/actions/workflows/test.yml)\n\nA [SAP CAP plugin](https://cap.cloud.sap/docs/node.js/cds-plugins) to validate incoming data.\n\nThis plugin uses [Ajv](https://www.npmjs.com/package/ajv), a [JSON schema](https://json-schema.org/) validator. All validation keywords available in `Ajv` (draft-07) can be used.\n\n## Setup\n\nAll you need to do is to install the plugin and add the `@Validator` annotations to your entities.\n\n### Installation\n\nInstall the plugin as an npm module:\n\n```shell\nnpm install sap-cap-validator-plugin\n```\n\n### Annotation\n\nThe annotation tag is `@Validator`. You can add and combine valid rules from JSON Schema such as [types](https://ajv.js.org/json-schema.html) and [formats](https://ajv.js.org/packages/ajv-formats.html)\n\n```js\nusing {myService as service} from './services';\n\nannotate service.myEntity with {\n  field_duration            @Validator: {format: 'duration'};\n  field_uri                 @Validator: {format: 'uri'};\n  field_url                 @Validator: {format: 'url'};\n  field_email               @Validator: {format: 'email'};\n  field_hostname            @Validator: {format: 'hostname'};\n  field_ipv4                @Validator: {format: 'ipv4'};\n  field_ipv6                @Validator: {format: 'ipv6'};\n  field_datetime            @Validator: {\n    type: 'string',\n    format: 'date-time'\n  };\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauriciolauffer%2Fsap-cap-validator-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauriciolauffer%2Fsap-cap-validator-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauriciolauffer%2Fsap-cap-validator-plugin/lists"}