我想发送此类作为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)