Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-1266

@BasePathAwareController disables DTO validation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Given I have web application based on Spring Data REST and following DTO and controller mapping (I kept only important information)

      @Getter
      @Setter
      public class UpstreamEvent {
          @NotNull    
          @DateTimeFormat(iso = DATE)    
          private LocalDate transactionDate;
      }
      
      @BasePathAwareController
      @RestController
      public class ProcessEventController {
          @PutMapping(path = "/process-event") 
          public PagedResources<Resource<Merchant>> processEvent(
                                     @Valid @RequestBody UpstreamEvent event) { 
          } 
      } 
      

      When I don't have @BasePathAwareController, Spring validation kicks in.

      When I do have, it's not working

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              caparzo Patrik Mihalcin
              Last updater:
              Oliver Drotbohm
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: