Rendering of generics as response
See original GitHub issueHi! Using Springfox 2.0.0 Having this rest operation
@RequestMapping(
value = "/pop/{referenceId}",
method = RequestMethod.DELETE,
produces = ContentTypes.LIST
)
@ApiOperation(value = "Pop operation",
notes = "Pops it")
public DeferredResult<ResponseEntity<StateList>> pop_1_0(
@PathVariable(value="referenceId") final String referenceId, @ApiIgnore final HttpEntity<String> request) {
...
}}
Here is part of my config
/**
* Swagger Spring MVC configuration
*/
@Bean
public Docket swaggerSpringMvcPlugin() {
return new Docket(DocumentationType.SWAGGER_2)
.genericModelSubstitutes(ResponseEntity.class, DeferredResult.class)
.select()
.paths(paths()) // and by paths
.build()
.apiInfo(apiInfo());
}
How would I configure springfox to render StateList as the response type correctly?
Now it renders this to ResponseEntity<StateList> in swagger-ui and nothing more is shown. Do I need to add add a alternaterule and if that is the case how would that rule be implemented.
Thanks in advance.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Generic View for Rendering JSON and HTML - Stack Overflow
Generic View for Rendering JSON and HTML ... In ListAPIView, I try to overload the class for rendering HTML and JSON as below....
Read more >Renderers - Django REST framework
This renderer is used for rendering HTML multipart form data. It is not suitable as a response renderer, but is instead used for...
Read more >Typescript generics for React developers - Developer way
Looking into why we need generics in Typescript, and how to use them to develop re-usable React components. And as a bonus: the...
Read more >Example Using Generic (JSON) Resource Objects - Bloomreach
Resource is the primary object representation to solve all the complex integration problems in a generic way. So, the interface was designed to...
Read more >OpenAPI generation couldn't infer response type for generic ...
When I inherit a resource from a generic base resource, and the response type is the generic type argument, then it will not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok thanks!
Resolved it like this.
@emanuelbatista Without really testing I would have to say no.