-
-
Notifications
You must be signed in to change notification settings - Fork 548
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
To Reproduce
Steps to reproduce the behavior:
- Spring Boot 3.0.4 or 2.7.8
- springdoc-openapi-starter-webmvc-ui:2.0.4 or 1.6.15
@Configuration
public class ApiWebMvcConfiguration extends DelegatingWebMvcConfiguration {
@Autowired
Jackson2ObjectMapperBuilder jacksonBuilder;
@Override
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
var applicationContext = this.getApplicationContext();
if (applicationContext != null) {
jacksonBuilder.applicationContext(applicationContext);
}
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
}
}
Expected behavior
Expected:
{
"openapi": "3.0.1",
"info": {
"title": "OpenAPI definition",
"version": "v0"
},
"servers": [
{
"url": "http://localhost:8080",
"description": "Generated server url"
}
],
"paths": {
...
},
"components": {}
}
Actual:
"eyJvcGVuYXBpIjoiMy4wLjEiLCJpbmZvIjp7InRpdGxlIjoiT3BlbkFQSSBkZWZpbml0aW9uIiwidmVyc2lvbiI6InYwIn0sInNlcnZlcnMiOlt7InVybCI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImRlc2NyaXB0aW9uIjoiR2VuZXJhdGVkIHNlcnZlciB1cmwifV0sInBhdGhzIjp7Ii9pZC92MS8iOnsiZ2V0Ijp7InRhZ3MiOlsiZGVtby1jb250cm9sbGVyIl0sInN1bW1hcnkiOiJPSyIsIm9wZXJhdGlvbklkIjoiaW5zdGFuY2VDb25maWciLCJyZXNwb25zZXMiOnsiMjAwIjp7ImRlc2NyaXB0aW9uIjoiT0siLCJjb250ZW50Ijp7IiovKiI6eyJzY2hlbWEiOnsidHlwZSI6InN0cmluZyJ9fX19fX19fSwiY29tcG9uZW50cyI6e319"
This causes swagger-ui to be unable to parse the response
Additional context
I believe this is caused by the changes required for fixing #2051. I tried both adding and removing StringHttpMessageConverter, but the only thing that helps is not registering MappingJackson2HttpMessageConverter
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested