New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service description has no api's as the path regular expression does not match any of the service #1125
Comments
Can you try removing the |
Dear dilipkrish, paths("./rest/.") also didn't make any difference. I mean no error but no api either. |
Could you share the stacktrace. |
Yes sure!
|
Related to: It works if I use something like this @RequestMapping(value = "/{id}", method = RequestMethod.GET)
public MyObjectVO getMyObjectById(@PathVariable("id") String id) {
MyObjectVO myObjectVO = myService.getMyObjectById(id);
return myObjectVO;
// Resource<MyObjectVO> resource = myObjectResourceAssembler.toResource(myObjectVO);
// return new ResponseEntity<Resource<MyObjectVO>>(resource, HttpStatus.OK);
} MyObjectVO extends ResourceSupport class. |
@irfandawood before your change what did the signature look like? and what does your MyObjectVO look like? Im asking so that we can fix this bug |
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseEntity<Resource<MyObjectVO>> getMyObjectById(@PathVariable("id") String id) {
MyObjectVO myObjectVO = myService.getMyObjectById(id);
Resource<MyObjectVO> resource = myObjectResourceAssembler.toResource(myObjectVO);
return new ResponseEntity<Resource<MyObjectVO>>(resource, HttpStatus.OK);
} public class MyObjectVO extends ResourceSupport {
private String id;
// And some more private fields with getter and setter methods
} |
Hi @dilipkrish Any idea why it is not working when I use Spring Hateoas Resource class? |
@irfandawood I'll investigate and try to patch if possible |
I am trying to set up Swagger 2 using Springfox in my Spring mvc based application. I am not using Spring Boot.
When I use .paths(PathSelectors.regex("/rest/.*")), I can see the following json when I hit http://localhost:8080/myservice/rest/v2/api-docs. Apparently its only picking up .apiInfo() but nothing from my actual RestController.
"swagger":"2.0","info":{"description":"This is a description of your API.","version":"API TOS","title":"My Project's REST API","termsOfService":"me@wherever.com","contact":{"name":"API License"},"license":{"name":"API License URL"}},"host":"localhost:8080","basePath":"/myservice"}
Any idea?
The text was updated successfully, but these errors were encountered: