We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
358-370页 9.4.2 bean的条件注解 一章用到的例子FormatterAutoConfiguration要输出objectMapperFormatter的前提条件是 JacksonAutoConfiguration.JacksonObjectMapperConfiguration#jacksonObjectMapper matched ,这里的隐含条件是JacksonAutoConfiguration要先于FormatterAutoConfiguration配置好,您的例子刚好,正确输出了[Bean name : objectMapperFormatter] JsonFormatter.format(data) : {"name":"小马哥"},而我的例子始终只能输出jsonFormatter,不知何故?
后来我在您的例子上加上 @AutoConfigureBefore(JacksonAutoConfiguration.class) public class FormatterAutoConfiguration 后,也只能输出jsonFormatter
而在我的例子上加上 @AutoConfigureAfter(JacksonAutoConfiguration.class) public class FormatterAutoConfiguration 后,也能正确输出objectMapperFormatter
建议您再版时,加上这个隐含条件
The text was updated successfully, but these errors were encountered:
这里我今天看到这里也发现了,windows11,debug之后发现加载FormatterAutoConfiguration中的三个bean的时候,去根据条件判断是否注册的时候ObjectMapper的Bean是还没有注册的,发生和你一样的情况,小马哥后续确实可以标注一下,不过我搜了一下小马哥在这个 #53 回复了这个问题
Sorry, something went wrong.
No branches or pull requests
358-370页 9.4.2 bean的条件注解 一章用到的例子FormatterAutoConfiguration要输出objectMapperFormatter的前提条件是 JacksonAutoConfiguration.JacksonObjectMapperConfiguration#jacksonObjectMapper matched ,这里的隐含条件是JacksonAutoConfiguration要先于FormatterAutoConfiguration配置好,您的例子刚好,正确输出了[Bean name : objectMapperFormatter] JsonFormatter.format(data) : {"name":"小马哥"},而我的例子始终只能输出jsonFormatter,不知何故?
后来我在您的例子上加上
@AutoConfigureBefore(JacksonAutoConfiguration.class)
public class FormatterAutoConfiguration
后,也只能输出jsonFormatter
而在我的例子上加上
@AutoConfigureAfter(JacksonAutoConfiguration.class)
public class FormatterAutoConfiguration
后,也能正确输出objectMapperFormatter
建议您再版时,加上这个隐含条件
The text was updated successfully, but these errors were encountered: