Issue
My OpenApi gone crazy... i created 2 simple rest APIs
@RequestMapping("/inWithHibernate")
@PutMapping
public void inDbMobile() {
hibernateInsert.inDB();
}
@RequestMapping("/outWithHibernate")
@GetMapping
public MobileEntity outDbMobile(@RequestParam(name = "id")Long id) {
return hibernateInsert.fromDB(id);
}
as i understand it it should show one Put method and one Get method...Instead of that is shows all of the methods, can you please explain what is happening ?
my dependency
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.12</version>
</dependency>
Solution
The @RequestMapping
tells Spring that any HTTP request with the specified path should be mapped to the corresponding method. The path should be specified as an argument of the @PutMapping
and @GetMapping
annotations and the @RequestMapping
annotation should be removed.
Answered By - birca123
Answer Checked By - Marilyn (JavaFixing Volunteer)