Uploaded image for project: 'Hibernate Validator'
  1. HV-1493

Support a temporal validation tolerance when applying temporal constraints

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0.5.Final
    • Component/s: engine
    • Labels:
      None

      Description

      It is somewhat difficult to keep time in sync in distributed systems. Picking a (lets say "now at the wall clock") time at the client (which could be a browser that we have no control over) and instantly sending it to the backend can easily cause constraint validation for Future/FutureOrPresent constraint violations in one or Past/PastOrPresent constraint violations in the other direction. It would be nice if it would be possible to specify a skewTolerance-Duration as optional parameter for time based constraints or as a global validator property/ or property of the clock provider.

      What do you think about something like?

      @SkewTolerantFutureOrPresent(skewTolerance=@Tolerance(amount=5, unit=TimeUnit.SECONDS))
      

      Originally suggested as BVAL-700 Open , but as Gunnar mentioned, BV 2 is out and this will not make it there any time soon.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: