I'm using Kotlin with https://github.com/vojtechhabarta/typescript-generator to generate TypeScript definitions for my classes that are used in an API.
To preserve nullability information, typescript-generator can use annotations present on fields and methods. It supports arbitrary annotation class names, listed in the build script.
Kotlin, for some reason, annotates nullable fields with @org.jetbrains.annotations.Nullable rather than the JSR-305 annotation, @javax.annotation.Nullable.
While the JSR-305 annotation has RetentionPolicy.RUNTIME, the Jetbrains annotation has RetentionPolicy.CLASS, making it unsuitable for introspection by libraries which use Java Reflection to detect annotations.
Is it possible to have Kotlin generate standards-based annotations instead of the JetBrains proprietary annotations?
If not, I'm interested in simple solutions to handle the issue. Perhaps a Gradle plugin that can generate JSR-305 annotations from the JetBrains ones or similar. I would really prefer to not have to double-annotate everything with a ? and @Nullable.