Support beans as parameter in @GetMapping / components empty
See original GitHub issueIt would be great if beans are supported in GET
endpoints.
@RestController
public class MyController {
@GetMapping
public Object persons(@Valid PersonDto person) {
}
}
class PersonDto {
@NotBlank private String name;
@NotNull private Integer age;
}
In this case, the following error is printed:
Resolver error at paths./my/persons.get.parameters.0.schema.$ref Could not resolve reference: Could not resolve pointer: /components/schemas/PersonDto does not exist in document
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
Springboot @GetMapping method injection with object as ...
Bean is an object managed by the Spring context. Objects of these classes do not need to be created - Spring is responsible...
Read more >CORS support in Spring Framework
Spring Framework 4.2 GA provides first class support for CORS ... it is recommended to just declare a WebMvcConfigurer bean as following:
Read more >Validation with Spring Boot - the Complete Guide - Reflectoring
A tutorial consolidating the most important features you'll need to integrate Bean Validation into your Spring Boot application.
Read more >Using Custom Data Binders in Spring MVC - Baeldung
Binding Individual Objects to Request Parameters ... @Component public class StringToLocalDateTimeConverter implements Converter<String, ...
Read more >F.A.Q - Springdoc-openapi
To enable the support of multiple OpenAPI definitions, a bean of type ... You can define common parameters under parameters in the global...
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 FreeTop 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
Top GitHub Comments
Tested this with v1.1.26. Even though OpenAPI 3.0 yaml export seems ok
i’m still not sure if this the correct output here as swagger-ui does not seem to recognise this. I would expect that in swagger-ui Parameters are expanded to include the fields in PersonDto, but this is not the case.
Screenshot of swagger-ui:
I tested this with springfox and OpenAPI 2 and the expansion of bean to it’s properties when used in a GET request, seems to work fine.
To make it more clear i would expect the outcome in this case to be:
So you’re actually saying that as of now, it’s still not possible to show the fields of a bean as input in swagger-ui?