accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From glitch <>
Subject [GitHub] accumulo issue #289: ACCUMULO-4677 Sanitizing PathParam values in REST-based...
Date Tue, 08 Aug 2017 22:13:01 GMT
Github user glitch commented on the issue:
    @milleruntime What's your feeling on using javax.validation.constraints right in the method
signature?  Doing that I can pretty much eliminate the ParameterValidator class altogether.
      public TraceList getTracesType(@PathParam("id") @NotNull @Pattern(regexp = "\\w+") String
id) throws Exception {
    For int params:
    `@DefaultValue("10") @PathParam("minutes") @NotNull @Min(0) @Max(2592000) int minutes`
    It loses the single class encapsulation, but on the other hand you can really fine tune
each method and it makes it self documenting.  It looks like support is built directly into
Jersey for it.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message