You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 12, 2020. It is now read-only.
Currently RAVE limits this, though I'm not sure why. It's indirectly enforced by checking for multiple factories during verification, but this seems to be imposed by its inverted approach of using @Validated annotations to determine the factory to generate. I'm not sure if there was any other intention.
I actually ran into this in an unrelated bug where compilation with multiple modules that have duplicate package-info.java files will actually include multiple modules' models in the same processing round. Obviously this is a separate bug and would be really wasteful, but it got me thinking.
My suggestion would be this: Follow the approach used by auto-value-moshi/gson's factory processors and just collect all the @Validated and @Validator elements up front, then tie them together during processing. This would be api-invisible and not be a major breaking change to support.
I don't know that there's much use case for multiple validators per module, but if we're going to support/require specifying a validator per @Validated annotation it seems like we should at least support it. Otherwise I don't see why we have that specification requirement on @Validated annotations if they're all implicitly limited to one anyway.
The text was updated successfully, but these errors were encountered:
Didn't realize RAVE didn't have @Validator before, and now remember @behroozkhorashadi and I having a discussion about this before. I guess this is another reason why I think we should switch to that style for Rave 2.0 :)
Currently RAVE limits this, though I'm not sure why. It's indirectly enforced by checking for multiple factories during verification, but this seems to be imposed by its inverted approach of using
@Validated
annotations to determine the factory to generate. I'm not sure if there was any other intention.I actually ran into this in an unrelated bug where compilation with multiple modules that have duplicate
package-info.java
files will actually include multiple modules' models in the same processing round. Obviously this is a separate bug and would be really wasteful, but it got me thinking.My suggestion would be this: Follow the approach used by auto-value-moshi/gson's factory processors and just collect all the
@Validated
and@Validator
elements up front, then tie them together during processing. This would be api-invisible and not be a major breaking change to support.I don't know that there's much use case for multiple validators per module, but if we're going to support/require specifying a validator per
@Validated
annotation it seems like we should at least support it. Otherwise I don't see why we have that specification requirement on@Validated
annotations if they're all implicitly limited to one anyway.The text was updated successfully, but these errors were encountered: