|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
* Copyright 2012-2021 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.autoconfigure.data.rest;
|
|
|
|
package org.springframework.boot.autoconfigure.data.rest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.ObjectProvider;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
@ -30,6 +31,7 @@ import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
|
|
|
|
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
|
|
|
|
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
|
|
|
|
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
|
|
|
|
|
|
|
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data Rest's MVC
|
|
|
|
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data Rest's MVC
|
|
|
@ -56,8 +58,9 @@ import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguratio
|
|
|
|
public class RepositoryRestMvcAutoConfiguration {
|
|
|
|
public class RepositoryRestMvcAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public SpringBootRepositoryRestConfigurer springBootRepositoryRestConfigurer() {
|
|
|
|
public SpringBootRepositoryRestConfigurer springBootRepositoryRestConfigurer(
|
|
|
|
return new SpringBootRepositoryRestConfigurer();
|
|
|
|
ObjectProvider<Jackson2ObjectMapperBuilder> objectMapperBuilder, RepositoryRestProperties properties) {
|
|
|
|
|
|
|
|
return new SpringBootRepositoryRestConfigurer(objectMapperBuilder.getIfAvailable(), properties);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|