Search in sources :

Example 1 with SchemaMapper

use of io.confluent.ksql.rest.entity.SchemaMapper in project ksql by confluentinc.

the class KsqlRestApplication method configureBaseApplication.

@Override
public void configureBaseApplication(Configurable<?> config, Map<String, String> metricTags) {
    // Would call this but it registers additional, unwanted exception mappers
    // super.configureBaseApplication(config, metricTags);
    // Instead, just copy+paste the desired parts from Application.configureBaseApplication() here:
    ObjectMapper jsonMapper = getJsonMapper();
    new SchemaMapper().registerToObjectMapper(jsonMapper);
    JacksonMessageBodyProvider jsonProvider = new JacksonMessageBodyProvider(jsonMapper);
    config.register(jsonProvider);
    config.register(JsonParseExceptionMapper.class);
    // Don't want to buffer rows when streaming JSON in a request to the query resource
    config.property(ServerProperties.OUTBOUND_CONTENT_LENGTH_BUFFER, 0);
    if (isUiEnabled) {
        loadUiWar();
        config.property(ServletProperties.FILTER_STATIC_CONTENT_REGEX, "/(static/.*|.*html)");
    }
}
Also used : JacksonMessageBodyProvider(io.confluent.rest.validation.JacksonMessageBodyProvider) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) SchemaMapper(io.confluent.ksql.rest.entity.SchemaMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SchemaMapper (io.confluent.ksql.rest.entity.SchemaMapper)1 JacksonMessageBodyProvider (io.confluent.rest.validation.JacksonMessageBodyProvider)1