Spring boot path variable with underscore not invoking the controller
<p>Hi I am using spring boot 1.3.4. In my controller i have the following request mapping,</p>

<pre><code>@RequestMapping(value = "name/{name}",method = RequestMethod.GET)
public ResponseEntity&lt;Book&gt; getBooksByName(@Valid @PathVariable("name") String name) {
    final Book h = mongoService.findByBookName(name);
</code></pre>

<p><strong>Application.yml</strong></p>

<pre><code>server:
port: 8170
contextPath: /book-repository
spring:
    application:
        name: book-repository
    devtools:
        restart:
            exclude: META-INF/maven/**
            additional-paths: src/main/resources/
bookRepository:
    mongodb:
        connectionStrings:
            bookRepository: mongodb://localhost:27017/contentdb
springfox.documentation.swagger.v2.path: /api/v1
management.add-application-context-header: false
</code></pre>

<p><strong>BookRepositoryMain.java</strong></p>

<pre><code>@SpringBootApplication
public class BookRepositoryMain {

public static final Logger LOG = LoggerFactory.getLogger(BookRepositoryMain.class);

public static void main(String[] args) {
    LOG.info("Initialising ...");
    SpringApplication.run(BookRepositoryMain.class, args);
}
</code></pre>

<p>}</p>

<p><strong>BookController.java</strong></p>

<pre><code>@Api(value = "books", description = "books endpoint", tags = {"books"}, produces = MediaType.APPLICATION_JSON_VALUE)
@RestController
@RequestMapping(value = PATH, produces = MediaType.APPLICATION_JSON_VALUE)
public class BooksController {
public static final Logger LOG = LoggerFactory.getLogger(BooksController.class);
public static final String PATH = "/books";

@RequestMapping(
        value = "name/{name}",
        method = RequestMethod.GET)
@ApiOperation(
        response = Book.class,
        notes = "",
        value = "Finds Book by its name.")
@ApiResponses({
    @ApiResponse(code = 404, response = ErrorMessage.class, message = "Book not found.")
})
public ResponseEntity&lt;Book&gt; getBookByName(@PathVariable("name") String uid) throws ContentNotFoundException {
    final Book h = deviceMongoService.findByBookName(name);
    if (h == null) {
        throw new BookNotFoundException(String.format("Could not find book with name %s", name));
    }
    final ResponseEntity&lt;Book&gt; response = ResponseEntity.ok().body(h);
    return response;
}
</code></pre>

<p>}</p>

<p>If the URL is <strong>"api/v1/books/name/sherlock_homes"</strong> then the above method is <strong>not working</strong> but the URL is <strong>"api/v1/books/name/sherlockHomes"</strong> then it is <strong>working</strong> properly.</p>

<p>What might be the issue? Why spring doesn't allow underscore in path variable?</p>

<p>Your help should be appreciable.</p>