0

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>

OpenApi3.0

Helen
  • 87,344
  • 17
  • 243
  • 314
Jatel
  • 40
  • 8

1 Answers1

1

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.

Toni
  • 3,296
  • 2
  • 13
  • 34