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
Annotations that are generated by annotation transformers, that reference enum values, break the introspection they're on when that enum isn't present on the classpath.
This was a problem in the micronaut-security changes for micronaut-serialization. The micronaut-serialization annotation processor transforms jackson annotations to its own internal annotation model. The internal annotations may not be present on the classpath if jackson is used for serialization.
This error happens because the generated introspection class tries to access the missing enum constant.
For "normal" annotations, where no transformer is in play, this isn't an issue, because the enum values are written as strings and resolved lazily on request. This is also the approach I've used to fix this issue in micronaut-serialization: micronaut-projects/micronaut-serialization#115
We should consider doing this for all annotation enum values, e.g. by changing AnnotationValueBuilder to transform all enum values to strings. This will not have a negative correctness impact, since strings can always be lazily converted back, but it may have a negative impact on performance (constant load is faster than the valueOf call).
The text was updated successfully, but these errors were encountered:
Issue description
Annotations that are generated by annotation transformers, that reference enum values, break the introspection they're on when that enum isn't present on the classpath.
This was a problem in the micronaut-security changes for micronaut-serialization. The micronaut-serialization annotation processor transforms jackson annotations to its own internal annotation model. The internal annotations may not be present on the classpath if jackson is used for serialization.
This would lead to the following error: https://ge.micronaut.io/s/5gde4hmsyj374/failure?expanded-stacktrace=WyIwLTgtMTEtMTQtMTctMjAiLCI3LTEwLTEzLTE2LTE5LTIyIl0#1 (can't see how to copy the stack trace and I don't have it around locally anymore)
This error happens because the generated introspection class tries to access the missing enum constant.
For "normal" annotations, where no transformer is in play, this isn't an issue, because the enum values are written as strings and resolved lazily on request. This is also the approach I've used to fix this issue in micronaut-serialization: micronaut-projects/micronaut-serialization#115
We should consider doing this for all annotation enum values, e.g. by changing
AnnotationValueBuilder
to transform all enum values to strings. This will not have a negative correctness impact, since strings can always be lazily converted back, but it may have a negative impact on performance (constant load is faster than thevalueOf
call).The text was updated successfully, but these errors were encountered: