title: Trying to pass a date as a path variable on postman however i get error
body: <p>I am trying to query my database by passing a date param as path variable on postman using a get mapping, however i keep getting this error    "I am trying to query my database by passing a date param as path variable on postman using a get mapping, however I keep getting this error </p>
  
  <blockquote>
    <p>org.springframework.web.method.annotation.MethodArgumentTypeMismatchException:
    Failed to convert value of type 'java.lang.String' to required type
    'java.sql.Date'; nested exception is
    org.springframework.core.convert.ConversionFailedException: Failed to
    convert from type [java.lang.String] to type
    [@org.springframework.web.bind.annotation.PathVariable
    @org.springframework.format.annotation.DateTimeFormat java.sql.Date]
    for value '2019-07-24 11:50:34.896+01'; nested exception is
    org.springframework.core.convert.ConverterNotFoundException: No
    converter found capable of converting from type [java.util.Date] to
    type [@org.springframework.web.bind.annotation.PathVariable
    @org.springframework.format.annotation.DateTimeFormat java.sql.Date]]</p>
  </blockquote>
  
  <p>I have tried using the <code>@DateTimeFormat</code> as suggested by various people on line but it still isn't working.</p>
  
  <pre><code>@GetMapping("/walletledger/{fromDate}/{toDate}/{currencycode}")
  @PreAuthorize("hasAuthority('SUPERADMIN')")
  public List &lt; LedgerResponseDTO &gt; fetchWalletLedgers(
      @PathVariable("fromDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date fromDate,
      @PathVariable("toDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date toDate
  }
  </code></pre>
  
  <p>Implementation</p>
  
  <pre><code>@Override
  public List &lt; LedgerResponseDTO &gt; fetchWalletLedgers(
          Date fromDate,
          Date toDate,
          CurrencyCode currencyCode,
          Pageable pageable) {
          List &lt; LedgerResponseDTO &gt; ledgerList = new ArrayList &lt; &gt; ();
          ledgerRepository.findByExecutionDateAndExecutionDateAndCurrencyCode(fromDate, toDate, currencyCode).forEach(ledger - &gt; {
  </code></pre>