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

io.syndesis.integration.project.generator.templates.RestRouteConfiguration.mustache Maven / Gradle / Ivy

There is a newer version: 1.13.2
Show newest version
package io.syndesis.example;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RestRouteConfiguration {

    @Bean
    public RouteBuilder specificationRoute() {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                restConfiguration()
                    .contextPath("/")
                    .component("servlet")
                    .endpointProperty("headerFilterStrategy", "syndesisHeaderStrategy");

                rest()
                    .get("/openapi.json")
                    .description("Returns the OpenAPI specification for this service")
                    .route()
                    .setHeader(Exchange.CONTENT_TYPE, constant("application/vnd.oai.openapi+json"))
                    .setBody(constant("resource:classpath:openapi.json"));
            }
        };
    }

    @Bean
    public RouteBuilder restRoute() {
        return new RestRoute();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy