New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Classes with same name and validation decorators collide/overwrite each other #450

Open
aaronstaves opened this Issue Sep 6, 2018 · 0 comments

Comments

2 participants
@aaronstaves

aaronstaves commented Sep 6, 2018

Information

Type 聽Version
Bug 4.31.4 (also affects earlier versions)

Description

馃憠 I've created a repository with a more in-depth explanation here. 馃憟

No idea why this is happening, I can only speculate that validation definitions are registered/stored by using the class name and property of the object their validating. With that said --

I have 2 classes, that have the same name and are nearly identical in structure. Each class has a different validation method (i.e. @MaxLength(5) on a FirstName property for one class and a @MaxLength(10) on a FirstName property for another class. For some reason, no matter which endpoint I submit to, the conversion -> validation seems to only be validating against one of these classes and not both.

Changing the class name does fix this, but I would think that shouldn't matter in the long run.

Acceptance criteria

  • Sample repository listed in description validates against person criteria when posting to the /Person endpoint
  • Ability to have 2 identical classes (names and properties) with different validation criteria, and the conversion -> validation validates appropriately.

@aaronstaves aaronstaves changed the title from Bug: Classes with same name and validation decorators collide/overwrite each other to [Bug] Classes with same name and validation decorators collide/overwrite each other Sep 6, 2018

@Romakita Romakita added this to the BACKLOG milestone Sep 27, 2018

@Romakita Romakita added the bug label Sep 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment