Hello,

I have a scenario where a property has a different validation applied 
depending on end-point. This is done via "groups" (code example below & 
reference to dropwizard doc: 
http://www.dropwizard.io/0.9.3/docs/manual/validation.html#validated).

I implemented the DropWizard validations but the Swagger does not 
recognizing the "groups" and therefore doesn't provided correct model 
description. In addition Swagger doesn't seem to have any annotations that 
would accomplish the scenario.

Can you please help?

Thank you.


public interface Version1FirstName { }

public interface Version2FirstName { }


class Person {
 @NotEmpty(groups = Version1FirstName .class)
 @Length(max = 5, groups = Version2FirstName .class)
 private firstName;
 private lastName;
}


@POST@Path("/v1")public void addName(@Validated(Version1FirstName.class) Person 
person) {}
@POST@Path("/v2")public void retriveName(@Validated({Version2FirstName.class,
                                    Version1FirstName.class}) Person person) {}

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to