/validation-as-a-service

PoC of a spring boot application that uses validation rules from external service

Primary LanguageJava

validation-as-a-service

PoC of a spring boot application that uses validation rules from external service.

This project is based on Spring Cloud Function project.

IMPORTANT: Execution of a lambda is done inside of a sandbox. The template is as follows:

import java.util.*;
import java.util.function.*;
import reactor.core.publisher.Flux;

public class %s implements CompilationResultFactory<%s> {
    public %s<%s> getResult() {
        %s
    }
};

The rules can be specified in yml property file or any other mechanism. It might contain the in/out parameters as well as the body of validation.

Using org.springframework.cloud.function.compiler.java.SimpleClassLoader the rules are loadeded and compiled only during runtime.

HOW TO RUN:

$ mvn spring-boot:run

NOTE: The functionality might be extended to use js nashorn to provide js functions.