{"id":22612092,"url":"https://github.com/openvalidation/openvalidation","last_synced_at":"2025-04-11T08:52:24.630Z","repository":{"id":52535951,"uuid":"187229897","full_name":"openvalidation/openvalidation","owner":"openvalidation","description":"Compose validation rules in the language you use every day, openVALIDATION handles code creation for you.","archived":false,"fork":false,"pushed_at":"2022-03-30T20:09:20.000Z","size":5682,"stargazers_count":68,"open_issues_count":28,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-25T06:22:39.518Z","etag":null,"topics":["cli","code-generation","csharp","dsl","java-8","javascript","language","lowcode","natural-language","nocode","open-source","validation-rules"],"latest_commit_sha":null,"homepage":"http://openvalidation.io/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openvalidation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-17T14:23:38.000Z","updated_at":"2025-03-15T09:04:20.000Z","dependencies_parsed_at":"2022-09-14T13:22:32.573Z","dependency_job_id":null,"html_url":"https://github.com/openvalidation/openvalidation","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvalidation%2Fopenvalidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvalidation%2Fopenvalidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvalidation%2Fopenvalidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvalidation%2Fopenvalidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openvalidation","download_url":"https://codeload.github.com/openvalidation/openvalidation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248363310,"owners_count":21091327,"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":["cli","code-generation","csharp","dsl","java-8","javascript","language","lowcode","natural-language","nocode","open-source","validation-rules"],"created_at":"2024-12-08T17:09:44.401Z","updated_at":"2025-04-11T08:52:24.601Z","avatar_url":"https://github.com/openvalidation.png","language":"Java","readme":"\u003cbr/\u003e\u003cbr/\u003e\n\u003cp aling=\"center\"\u003e\u003cimg src=\"/docs/ci/openvalidation-nlc.png\" alt=\"openVALIDATION a natural language no-code compiler\"/\u003e\u003c/p\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n\n\u003cp\u003e\u0026nbsp;\u003cbr/\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://dev.azure.com/validaria/openvalidation/_build/latest?definitionId=1\u0026branchName=master\"\u003e\u003cimg src=\"https://img.shields.io/azure-devops/build/validaria/openvalidation/1/master?style=flat-square\u0026label=Azure%20DevOps%20Build\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://img.shields.io/azure-devops/tests/validaria/openvalidation/1?compact_message\"\u003e\u003cimg src=\"https://img.shields.io/azure-devops/tests/validaria/openvalidation/1?compact_message\u0026style=flat-square\" alt=\"Azure DevOps tests (compact)\"\u003e\u003c/a\u003e \n  \u003ca href=\"https://search.maven.org/search?q=g:io.openvalidation\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/io.openvalidation/openvalidation?style=flat-square\" alt=\"Maven Central\"\u003e\u003c/a\u003e \n  \u003ca href=\"https://twitter.com/openVALIDATION\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/openVALIDATION?style=flat-square\u0026logo=twitter\" alt=\"Follow us on Twitter\"\u003e\u003c/a\u003e \n \u003cbr/\u003e\u003cbr/\u003e\n \u003ca href=\"https://openvalidation.io\" target=\"_blank\"\u003eopenvalidation.io\u003c/a\u003e | \u003ca href=\"https://playground.openvalidation.io\" target=\"_blank\"\u003eplayground.openvalidation.io\u003c/a\u003e | \u003ca href=\"https://docs.openvalidation.io\" target=\"_blank\"\u003edocs.openvalidation.io\u003c/a\u003e\n  \u003cbr/\u003e\u003cbr/\u003e\n   \u003cspan\u003ea natural language (no-code) compiler for validation rules\u003c/span\u003e  \n\u003c/p\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## contents\n\u003cbr/\u003e\n\n- [introduction](#introduction)\n- [install](#install)\n  - [npm](#npm)\n  - [jar](#jar)\n  - [docker image](#docker-image)\n- [run](#run)\n  - [npm](#npm-cli)\n  - [jar](#executable-jar)\n  - [docker container](#docker-container)\n  - [result](#result)  \n  - [cli parameters](#cli-parameters)    \n- [integrate](#integrate)\n- [samples](#samples)\n- [understand](#understand)\n- [try](#try)\n- [contribute](#contribute)\n- [contact](#contact)\n- [license](#license)\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## introduction\n\u003cbr/\u003e\n\n\u003ca href=\"https://openvalidation.io\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg width=\"200\" src=\"docs/ci/logo-v2.png\" alt=\"a natural language compiler for validation rules\"\u003e\u003c/a\u003e\n\n\u003cbr/\u003e\n\nopenVALIDATION enables programming validation rules using natural languages, such as German or English. \n\nThe rules recorded in natural language are readable not only by humans but also by machines and therefore no longer need to be programmed by a software developer. This task is now taken over by openVALIDATION compiler. With integrated code generators, corresponding source code in the desired programming language can be generated automatically, such as Java, C#, JavaScript or Python, with more to come. This code can then be integrated into any application (services, frontends, middleware). \n\nWrite once, DONT CODE and run everywhere!\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## install\n\u003cbr/\u003e\n\n### npm\n\ninstall via npm as global cli command\n\n```bash\nnpm i openvalidation -g\n```\n\n\n### jar\n\nor just download the executable jar [here](https://downloadarchive.blob.core.windows.net/openvalidation-generator/openvalidation.jar) or via curl:\n\n```\ncurl 'https://downloadarchive.blob.core.windows.net/openvalidation-generator/openvalidation.jar' --output openvalidation.jar\n```\n\n\n### docker image\n\n```\ndocker pull openvalidation/openvalidation-rest\n```\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## run\n\u003cbr/\u003e\n\n### npm cli\n\n```bash\nopenvalidation -r \"user's age should not be less than 18 years\" -s \"{age:0}\" -c en -l javascript\n```\n\n\n### executable jar\n\n```\njava -jar openvalidation.jar -r \"user's age should not be less than 18 years\" -s \"{age : 0}\"  -c en -l javascript\n```\n\n\n### docker container\n```\n\ndocker run -p 7070:80  openvalidation/openvalidation-rest\n\ncurl -X POST -H \"Content-Type: application/json\" -d \"{\\\"rule\\\":\\\"user's age should not be less than 18 years\\\",\\\"culture\\\":\\\"en\\\",\\\"language\\\":\\\"JavaScript\\\",\\\"schema\\\":\\\"{age:0}\\\"}\" http://localhost:7070/\n\n```\n\u003cbr/\u003e\n\n### result\n\nThe following JavaScript code will be generated:\n\n```javascript\n\n\nvar HUMLValidator = function() {\n    var huml = new HUMLFramework();\n    \n        huml.appendRule(\"\",\n            [\"age\"],\n            \"user\u0026#x27;s age should not be less than 18 years\",\n            function(model) { \n                return huml.LESS_THAN(model.age, 18.0);\n            },\n            false\n        );\n\n    this.validate = function(model){\n        return huml.validate(model);\n    }\n}\n\n```\n\nThe generated code does not depend on 3'rd party libraries at all. Therefore, a custom framework is generated in addition to the rules. This framework contains a basic architecture to integrate the generated validation rules more easily into other systems.\n\u003cbr/\u003e\n\n### cli parameters\n\n\n**-r** (--rule)\n\nvalidation rule in a natural language\n\n**-s** (--schema)\n\nschema in JSON Schema or JSON Object format\n\n**-c** (--culture)\n\nculture code of the natural language. For example **de** for German or **en** for English. \nThe culture of **current system** will be used as Default if the parameter -c was not specified.\n**en** is the absolute fallback if specified culture not supported by openVALIDATION.\n\n**-l** (--language)\n\nthe programming language of the generation output. \n**Java** is a default language. Available: Java, JavaScript, CSharp, (Python and Rust are still in development)\n\n\n**-o** (--output)\n\nThe Output option defines a directory where the generated code files are stored. Without specifying the output parameter, the generated code is only displayed in the console. If no output directory is specified, the result will only be displayed in the console. \n\n\nSee more \u003ca href=\"https://docs.openvalidation.io/openvalidation-cli\" target=\"_blank\"\u003eCLI Options...\u003c/a\u003e at \u003ca href=\"https://docs.openvalidation.io\"\u003edocs.openvalidation.io\u003c/a\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## integrate\n\u003cbr/\u003e\n\nThe first step is to generate a rule in e.g. nodejs. To generate code files, the output directory must be defined with the parameter -o.\n\n\n```bash\nopenvalidation -r \"user's age should not be less than 18 years\" -s \"{age:0}\" -c en -l node -o ./\n```\n\nthe compiler generates 2 code files OpenValidation.js (the actual rules) and HUMLFramework.js (the generic framework)\n\nNow you can integrate the generated code into a NodeJS application:\n\n\n```javascript\n\nvar openVALIDATION = require('./OpenValidation.js');\n\nvar data = {name:'Alex', age:17};\n\nvar validationRESULT = openVALIDATION.validate(data);\n\nif (validationRESULT.hasErrors) {\n  console.log(validationRESULT.errors);\n} else {\n  console.log(\"this data is valid!\");\n}\n\n\n```\n\n\nFurther integration examples can be found [here](https://docs.openvalidation.io/openvalidation-integration).  \n\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## samples\n\u003cbr/\u003e\n\nHere are examples of different validation rules:\n\n\u003cbr/\u003e\n\u003ctable cellpadding=\"25\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003erule\u003c/th\u003e\n    \u003cth\u003eschema\u003c/th\u003e\n    \u003cth\u003edescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      the \u003ci\u003ename\u003c/i\u003e \u003cb\u003eshould\u003c/b\u003e be \u003ci\u003eAlex\u003c/i\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{name:''}\u003c/td\u003e\n    \u003ctd\u003esimple rule. The rule itself is also the error message\u003c/td\u003e    \n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      \u003cb\u003eif\u003c/b\u003e the \u003ci\u003ename\u003c/i\u003e \u003cb\u003eis not\u003c/b\u003e \u003ci\u003eAlex\u003c/i\u003e\u003cbr/\u003e \u003cb\u003ethen\u003c/b\u003e the given name is not Alex\n    \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{name:''}\u003c/td\u003e\n    \u003ctd\u003esimple if/then rule. The text after \u003cb\u003ethen\u003c/b\u003e is the error message\u003c/td\u003e    \n  \u003c/tr\u003e  \n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      a \u003ci\u003ename\u003c/i\u003e \u003cb\u003emust\u003c/b\u003e be \u003ci\u003eAlex\u003c/i\u003e, \u003ci\u003ePeter\u003c/i\u003e or \u003ci\u003eHelmut\u003c/i\u003e\n    \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{name:''}\u003c/td\u003e\n    \u003ctd\u003econdition with multiple(OR) values\u003c/td\u003e    \n  \u003c/tr\u003e   \n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      \u003ci\u003eBerlin\u003c/i\u003e \u003cb\u003eas\u003c/b\u003e \u003ci\u003ecapital city\u003c/i\u003e\u003cbr/\u003e\u003cbr/\u003e\n      the \u003ci\u003elocation\u003c/i\u003e \u003cb\u003ehas\u003c/b\u003e to be a \u003ci\u003ecapital city\u003c/i\u003e\n    \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{location:''}\u003c/td\u003e\n    \u003ctd\u003edomain specific expression as variable\u003c/td\u003e    \n  \u003c/tr\u003e   \n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      the \u003ci\u003eage\u003c/i\u003e \u003cb\u003eis smaller\u003c/b\u003e than \u003ci\u003e18\u003c/i\u003e years \u003cb\u003eas\u003c/b\u003e \u003ci\u003eunderage\u003c/i\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n      the user \u003cb\u003emust not\u003c/b\u003e be \u003ci\u003eunderage\u003c/i\u003e\u003cbr/\u003e\n      \u003cb\u003eand\u003c/b\u003e his \u003ci\u003ename\u003c/i\u003e \u003cb\u003eshould\u003c/b\u003e be \u003ci\u003eAlex\u003c/i\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{age:0, name:''}\u003c/td\u003e\n    \u003ctd\u003epreconditions as variable\u003c/td\u003e    \n  \u003c/tr\u003e   \n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      user's \u003ci\u003eage\u003c/i\u003e \u003cb\u003e-\u003c/b\u003e \u003ci\u003e18\u003c/i\u003e years \u003cb\u003eas\u003c/b\u003e \u003ci\u003eactual work experience\u003c/i\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{age:0}\u003c/td\u003e\n    \u003ctd\u003earithmetic\u003c/td\u003e    \n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      \u003ci\u003eage\u003c/i\u003e and \u003cb\u003esmaller as operator\u003c/b\u003e \u003ci\u003eyounger\u003c/i\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      user \u003cb\u003emust not\u003c/b\u003e be \u003ci\u003eyounger\u003c/i\u003e than \u003ci\u003e18\u003c/i\u003e years\n      \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{age:0}\u003c/td\u003e\n    \u003ctd\u003esemantic, domain specific comparison operator\u003c/td\u003e    \n  \u003c/tr\u003e   \n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      \u003cb\u003efirst\u003c/b\u003e item \u003cb\u003efrom\u003c/b\u003e \u003ci\u003enames\u003c/i\u003e \u003cb\u003eas\u003c/b\u003e \u003ci\u003eBoss\u003c/i\u003e\n\u003cbr/\u003e\u003cbr/\u003e    \n      the \u003ci\u003eBoss\u003c/i\u003e \u003cb\u003eshould\u003c/b\u003e be \u003ci\u003eAlex\u003c/i\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{names:['Alex','Peter','Helmut']}\u003c/td\u003e\n    \u003ctd\u003efirst item from list\u003c/td\u003e    \n  \u003c/tr\u003e     \n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n      \u003cb\u003efirst\u003c/b\u003e number \u003cb\u003efrom\u003c/b\u003e \u003ci\u003enumbers\u003c/i\u003e \u003cb\u003ewith\u003c/b\u003e a value \u003cb\u003ebigger\u003c/b\u003e than 3 \u003cb\u003eas\u003c/b\u003e \u003ci\u003emagic number\u003c/i\u003e\n\u003cbr/\u003e\u003cbr/\u003e    \n      the \u003ci\u003emagic number\u003c/i\u003e \u003cb\u003ehas\u003c/b\u003e to be \u003ci\u003e4\u003c/i\u003e\n      \u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e{numbers:[1,2,3,4,5,6,7]}\u003c/td\u003e\n    \u003ctd\u003efiltering the list\u003c/td\u003e    \n  \u003c/tr\u003e  \n  \n\u003c/table\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## understand\n\u003cbr/\u003e\n\nopenVALIDATION enables programming of validation rules using natural languages, such as German or English and many more.\nThe rules recorded in natural language are readable not only by humans but also by the computer and therefore no longer need to be programmed by a software developer.\n\n\n**The grammar**\n\nThe Grammar of openVALIDATION based on a natural language is both formal and natural. This distinguishes this grammar from other programming languages or DSL's. It allows the use of additional semantic or grammatical content. The additional content is only relevant for human readability. The machine, on the other hand, ignores this addition. Thus it is possible to express the rules in a grammatically correct way on the one hand and to give them a semantic context on the other. This all makes the rules easier to understand. Rules formulated with openVALIDATION are thus at the same time a formal, machine-processable specification, but also a documentation that is easy for humans to understand.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LZu2slXWxv3PqRBZ9rs%2F-L_6dad7BzkwzHIkvLuu%2F-L_6n6-bhPwuuuHonLpy%2Fgrammar2.png?alt=media\u0026token=b5588e1b-19df-4330-9575-43e33f39a0cd\" width=\"80%\"/\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\nFor more details check out our [documentation and guides](https://docs.openvalidation.io)\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## try\n\u003cbr/\u003e\n\ntry it out directly in the browser on the [playground](https://playground.openvalidation.io/)\n\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## contribute\n\u003cbr/\u003e\n\nWe still have 2 zeros in the version 0.0.X of openVALIDATION, so there is still a lot to do. If you want to join us, you are more than welcome to participate! \n\nCheck our [contribution guide](https://docs.openvalidation.io/contribution/contribution-guide).\n\nEven if you're not a developer or don't fully understand the technical part of openVALIDATION yet, it doesn't matter. There are many different ways to join the project. \n\nCheck our [contribution guide especially for beginners](https://docs.openvalidation.io/contribution/for-beginners)\n\n\n\n\u003cbr/\u003e\u003cbr/\u003e\nThank you to all the people and bots who already contributed to openVALIDATION!\n\n\u003c!-- generate new contributor list.. https://contributors-img.firebaseapp.com/ --\u003e\n\u003ca href=\"https://github.com/openvalidation/openvalidation/graphs/contributors\"\u003e\u003cimg src=\"https://contributors-img.firebaseapp.com/image?repo=openvalidation/openvalidation\"/\u003e\n\u003c/a\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## contact\n\u003cbr/\u003e\n\nYou can write an [E-Mail](mailto:validaria@openvalidation.io), mention our twitter account [@openVALIDATION](https://twitter.com/openVALIDATION) or message us at our Instagram account [@openvalidation_](https://www.instagram.com/openvalidation_/).\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n## license\n\u003cbr/\u003e\n\nopenVALIDATION was initially developed as part of a research project at [BROCKHAUS AG](http://brockhaus-ag.de) in Dortmund.\n\nOnly an Open Source solution can unfold its true potential. That's why we released it on GitHub as an open-source project under the Apache 2.0 license.\n\nSee [LICENSE.txt](LICENSE.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvalidation%2Fopenvalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvalidation%2Fopenvalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvalidation%2Fopenvalidation/lists"}