Spring boot 如何将带有类注释的@Configuration作为REST响应发送?在springboot中

Spring boot 如何将带有类注释的@Configuration作为REST响应发送?在springboot中,spring-boot,serialization,jackson,Spring Boot,Serialization,Jackson,我想发送这个类作为REST服务的响应 @Configuration @ConfigurationProperties(prefix = "test") public class Test { private String str; } 控制器具有以下方法: @Autowired private Test test; @GetMapping("/url") public Test config() { return test; } 我得到的例外是: Type definition

我想发送这个类作为REST服务的响应

@Configuration
@ConfigurationProperties(prefix = "test")
public class Test { 
private String str;
}
控制器具有以下方法:

@Autowired
private Test test;

@GetMapping("/url")
public Test config() {
    return test;
}
我得到的例外是:

Type definition error: [simple type, class org.springframework.beans.support.ResourceEditorRegistrar]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.beans.support.ResourceEditorRegistrar and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

您需要该类的序列化程序。。另外,返回
test
和not
test
@DanielM您能给出一个序列化程序的示例代码吗?