All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java-camel-server.validation.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package {{apiPackage}};

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;
import org.apache.camel.LoggingLevel;

@Component
public class {{classname}}Validator extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        onException(Exception.class)
            .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}")
            .handled(true)
            .process("{{camelValidationErrorProcessor}}");
        {{#operations}}{{#operation}}
        from("direct:validate-{{operationId}}")
            .id("validate-{{operationId}}"){{#hasConsumes}}
            .to("bean-validator://validate-request"){{/hasConsumes}}
            .to("direct:{{operationId}}"){{^hasProduces}};{{/hasProduces}}{{#hasProduces}}
            .to("bean-validator://validate-response");{{/hasProduces}}
        {{/operation}}{{/operations}}
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy