1

We have a java 19, spring boot 3.0.5 based web application, that has an endpoint with a generated POJO object from a .proto as its @RequestBody. we are exposing the endpoint through swagger ui. swagger ui is based on the springdoc dependency -> 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'. when trying to access this specific endpoint in swagger ui, the browser gets stuck and freezes.

Other endpoints with the exact same configuration but a String as their @RequestBody work fine. also this endpoint worked fine when we used springfox as the swagger ui implementation, but the springfox implementation doesn't work with spring boot 3. we have tried to override the ProtobufJsonFormatHttpMessageConverter with:

@Bean
public ProtobufJsonFormatHttpMessageConverter protobufHttpMessageConverter() {
    return new          ProtobufJsonFormatHttpMessageConverter(JsonFormat.parser().ignoringUnknownFields(),
            JsonFormat.printer().omittingInsignificantWhitespace());
} 

but it didn't work.

1 Answers1

0

Found the solution here: springdoc-openapi-ui can not render Protobuf Models causing the browser to crash . need to define a ModelResolver bean with a custom ObjectMapper.