Skip to content

How is FastJson2 integrated in Springboot? #7

@Yu-Xiao-Sheng

Description

@Yu-Xiao-Sheng

In the FastJson1.X version, I added FastJson to the SpringIOC container by configuring the following beans.

@Bean
public HttpMessageConverters fadtJsonHttpMessageConverters(){
    FastJsonHttpMessageConverter fastJsonHttpMessageConverter = new FastJsonHttpMessageConverter();
    FastJsonConfig fastJsonConfig = new FastJsonConfig();
    fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
    fastJsonHttpMessageConverter.setFastJsonConfig(fastJsonConfig);
    HttpMessageConverter<?> converter = fastJsonHttpMessageConverter;
    return new HttpMessageConverters(converter);
}

But it seems to be no longer available in FastJson2. Is there any good way?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions