-
-
Notifications
You must be signed in to change notification settings - Fork 104
Java Spring duplicate parameter extraction #631
Copy link
Copy link
Closed
Description
Describe the bug
Noir incorrectly duplicates path parameters and mishandles @RequestParam in OpenAPI output
To Reproduce
Steps to reproduce the behavior:
- Create controller:
package com.test;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/v1/test")
public class MyController {
@DeleteMapping(value = "{token}/test")
public String Test(
@Test @PathVariable(name = "token") String token,
) {
return "hello!";
}
}- Run noir
./bin/noir -b spec/functional_test/fixtures/java/spring/ -f oas3 - Observe output
{"openapi":"3.0.0","info":{"title":"Generated by Noir","version":""},"paths":{"/api/v1/test/{token}/test":{"delete":{"responses":{"200":{"description":"Successful response"}},"parameters":[{"name":"token","in":"query"},{"name":"token","in":"query"}]}}...Expected behavior
Correct OpenAPI output should:
{"openapi":"3.0.0","info":{"title":"Generated by Noir","version":""},"paths":{"/api/v1/test/{token}/test":{"delete":{"responses":{"200":{"description":"Successful response"}},"parameters":[{"name":"token","in":"query"}]}}...1 token param instead of 2
Versions
- OS: linux
- Version v0.22.0
Reactions are currently unavailable
Metadata
Metadata
Labels
🐞 bugSomething isn't workingSomething isn't working

