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

Spring RequestMapping "path" variable is ignored #162

ST-DDT opened this Issue Oct 24, 2015 · 1 comment


None yet
2 participants

ST-DDT commented Oct 24, 2015

Spring's RequestMapping anntoation has an alias for value called path that don't get picked up by the documentation generator.


@RequestMapping(path = "/register")
public String register() {

@RequestMapping(path = "/", method = RequestMethod.POST)
public ModelAndView register(...) {

But it will be shown correctly if I use the value attribute for the mapping.

@RequestMapping(value = "/register")
public String register() {

@RequestMapping(value = "/", method = RequestMethod.POST)
public ModelAndView register(...) {

However I prefer using path as it say more about what the param is describing. This becomes more important if you have more attributes on the annotation. The path value is also easier to read during code reviews or when showing the code to other people that might not have that much experience with spring.

@RequestMapping(path = "/version", method = RequestMethod.GET, 
        consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, ...},
        produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE, ...},
        name="Version validation", headers="ext: *")

I use

  • Spring: 4.2.2.RELEASE
    <!-- The Apache Software License, Version 2.0 -->
  • JsonDoc: 1.2.9
    <!-- MIT License -->

PS: Thanks for your nice tool + work.


This comment has been minimized.

Show comment
Hide comment

fabiomaffioletti commented Nov 21, 2015

See #171

@fabiomaffioletti fabiomaffioletti added this to the 1.2.12 milestone Apr 14, 2016

@fabiomaffioletti fabiomaffioletti self-assigned this Apr 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment