All Projects → openvalidation → openvalidation

openvalidation / openvalidation

Licence: Apache-2.0 license
Compose validation rules in the language you use every day, openVALIDATION handles code creation for you.

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects
HTML
75241 projects

Projects that are alternatives of or similar to openvalidation

Budibase
Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
Stars: ✭ 8,071 (+12917.74%)
Mutual labels:  nocode, lowcode
plasmic
Visual page builder and web design tool for any website or web app tech stack
Stars: ✭ 1,475 (+2279.03%)
Mutual labels:  nocode, lowcode
vite-vue3-lowcode
vue3.x + vite2.x + vant + element-plus H5移动端低代码平台 lowcode 可视化拖拽 可视化编辑器 visual editor 类似易企秀的H5制作、建站工具、可视化搭建工具
Stars: ✭ 1,309 (+2011.29%)
Mutual labels:  nocode, lowcode
epage-core
epage 核心依赖 低代码可视化配置
Stars: ✭ 22 (-64.52%)
Mutual labels:  nocode, lowcode
Brick Design
全场景流式布局,可视化拖拽、随意嵌套组合、实时渲染、实时辅助线展示,实时组件间距展示、实时拖拽排序、状态域管理,可视化属性配置、可视化样式配置、多设备适配展示,支持逻辑渲染、模板字符变量、表达式、自定义方法、自定义状态
Stars: ✭ 4,048 (+6429.03%)
Mutual labels:  nocode, lowcode
Blocks
A JSX-based page builder for creating beautiful websites without writing code
Stars: ✭ 4,300 (+6835.48%)
Mutual labels:  nocode, lowcode
Awesome Lowcode
国内低代码平台从业者交流
Stars: ✭ 7,099 (+11350%)
Mutual labels:  nocode, lowcode
lightning
A Django based no code Admin and low code develop framework
Stars: ✭ 122 (+96.77%)
Mutual labels:  nocode, lowcode
sample-generator
Xcode Source Editor Extension to generate Swift model samples
Stars: ✭ 19 (-69.35%)
Mutual labels:  code-generation
gonstructor
A command-line tool to generate a constructor for the struct.
Stars: ✭ 55 (-11.29%)
Mutual labels:  code-generation
buzzwords
List of (possible) English buzzword words
Stars: ✭ 51 (-17.74%)
Mutual labels:  natural-language
granate
Code generator for graphql
Stars: ✭ 21 (-66.13%)
Mutual labels:  code-generation
Rosalina
Rosalina is a code generation tool for Unity's UI documents. It generates C# code-behind script based on a UXML template.
Stars: ✭ 57 (-8.06%)
Mutual labels:  code-generation
cscg
Code Generation as a Dual Task of Code Summarization.
Stars: ✭ 28 (-54.84%)
Mutual labels:  code-generation
LinqToXsdCore
LinqToXsd ported to .NET Core (targets .NET Standard 2 for generated code and .NET Core 3.1, .NET 5+ 6 for the code generator CLI tool).
Stars: ✭ 23 (-62.9%)
Mutual labels:  code-generation
designto-code
Design to code engine. A design ✌️ code standard. Supports React, Flutter and more.
Stars: ✭ 87 (+40.32%)
Mutual labels:  code-generation
hedges
List of (possible) English hedge words
Stars: ✭ 39 (-37.1%)
Mutual labels:  natural-language
imove
INACTIVE: Move your mouse, generate code from flow chart
Stars: ✭ 3,598 (+5703.23%)
Mutual labels:  lowcode
remark-retext
plugin to transform from remark (Markdown) to retext (natural language)
Stars: ✭ 18 (-70.97%)
Mutual labels:  natural-language
eaf-linter
🤪 A linter, prettier, and test suite that does everything as-simple-as-possible.
Stars: ✭ 17 (-72.58%)
Mutual labels:  code-generation



openVALIDATION a natural language no-code compiler






 

Build Status Azure DevOps tests (compact) Maven Central Follow us on Twitter

openvalidation.io | playground.openvalidation.io | docs.openvalidation.io

a natural language (no-code) compiler for validation rules




contents





introduction


a natural language compiler for validation rules


openVALIDATION enables programming validation rules using natural languages, such as German or English.

The 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).

Write once, DONT CODE and run everywhere!




install


npm

install via npm as global cli command

npm i openvalidation -g

jar

or just download the executable jar here or via curl:

curl 'https://downloadarchive.blob.core.windows.net/openvalidation-generator/openvalidation.jar' --output openvalidation.jar

docker image

docker pull openvalidation/openvalidation-rest




run


npm cli

openvalidation -r "user's age should not be less than 18 years" -s "{age:0}" -c en -l javascript

executable jar

java -jar openvalidation.jar -r "user's age should not be less than 18 years" -s "{age : 0}"  -c en -l javascript

docker container


docker run -p 7070:80  openvalidation/openvalidation-rest

curl -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/


result

The following JavaScript code will be generated:

var HUMLValidator = function() {
    var huml = new HUMLFramework();
    
        huml.appendRule("",
            ["age"],
            "user's age should not be less than 18 years",
            function(model) { 
                return huml.LESS_THAN(model.age, 18.0);
            },
            false
        );

    this.validate = function(model){
        return huml.validate(model);
    }
}

The 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.

cli parameters

-r (--rule)

validation rule in a natural language

-s (--schema)

schema in JSON Schema or JSON Object format

-c (--culture)

culture code of the natural language. For example de for German or en for English. The culture of current system will be used as Default if the parameter -c was not specified. en is the absolute fallback if specified culture not supported by openVALIDATION.

-l (--language)

the programming language of the generation output. Java is a default language. Available: Java, JavaScript, CSharp, (Python and Rust are still in development)

-o (--output)

The 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.

See more CLI Options... at docs.openvalidation.io




integrate


The 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.

openvalidation -r "user's age should not be less than 18 years" -s "{age:0}" -c en -l node -o ./

the compiler generates 2 code files OpenValidation.js (the actual rules) and HUMLFramework.js (the generic framework)

Now you can integrate the generated code into a NodeJS application:

var openVALIDATION = require('./OpenValidation.js');

var data = {name:'Alex', age:17};

var validationRESULT = openVALIDATION.validate(data);

if (validationRESULT.hasErrors) {
  console.log(validationRESULT.errors);
} else {
  console.log("this data is valid!");
}

Further integration examples can be found here.




samples


Here are examples of different validation rules:


rule schema description


the name should be Alex

{name:''} simple rule. The rule itself is also the error message


if the name is not Alex
then the given name is not Alex

{name:''} simple if/then rule. The text after then is the error message


a name must be Alex, Peter or Helmut

{name:''} condition with multiple(OR) values


Berlin as capital city

the location has to be a capital city

{location:''} domain specific expression as variable


the age is smaller than 18 years as underage

the user must not be underage
and his name should be Alex

{age:0, name:''} preconditions as variable


user's age - 18 years as actual work experience

{age:0} arithmetic


age and smaller as operator younger

user must not be younger than 18 years

{age:0} semantic, domain specific comparison operator


first item from names as Boss

the Boss should be Alex

{names:['Alex','Peter','Helmut']} first item from list


first number from numbers with a value bigger than 3 as magic number

the magic number has to be 4

{numbers:[1,2,3,4,5,6,7]} filtering the list




understand


openVALIDATION enables programming of validation rules using natural languages, such as German or English and many more. The 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.

The grammar

The 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.



For more details check out our documentation and guides




try


try it out directly in the browser on the playground




contribute


We 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!

Check our contribution guide.

Even 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.

Check our contribution guide especially for beginners



Thank you to all the people and bots who already contributed to openVALIDATION!




contact


You can write an E-Mail, mention our twitter account @openVALIDATION or message us at our Instagram account @openvalidation_.




license


openVALIDATION was initially developed as part of a research project at BROCKHAUS AG in Dortmund.

Only 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.

See LICENSE.txt

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].