Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @MustBeDocumented to certain annotations #2059

Merged
merged 1 commit into from Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/commonMain/src/kotlinx/serialization/Annotations.kt
Expand Up @@ -67,6 +67,7 @@ import kotlin.reflect.*
* @see UseSerializers
* @see Serializer
*/
@MustBeDocumented
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS, AnnotationTarget.TYPE)
//@Retention(AnnotationRetention.RUNTIME) // Runtime is the default retention, also see KT-41082
public annotation class Serializable(
Expand Down Expand Up @@ -97,6 +98,7 @@ public annotation class Serializable(
* @see UseSerializers
* @see Serializer
*/
@MustBeDocumented
@Target(AnnotationTarget.ANNOTATION_CLASS)
//@Retention(AnnotationRetention.RUNTIME) // Runtime is the default retention, also see KT-41082
@ExperimentalSerializationApi
Expand All @@ -111,6 +113,7 @@ public annotation class MetaSerializable
* Changes may include additional constraints on classes and objects marked with this annotation,
* behavioural changes and even serialized shape of the class.
*/
@MustBeDocumented
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
@ExperimentalSerializationApi
Expand Down Expand Up @@ -217,6 +220,7 @@ public annotation class EncodeDefault(val mode: Mode = Mode.ALWAYS) {
* Keep in mind that Kotlin compiler prioritizes [function parameter target][AnnotationTarget.VALUE_PARAMETER] over [property target][AnnotationTarget.PROPERTY],
* so serial info annotations used on constructor-parameters-as-properties without explicit declaration-site or use-site target are not preserved.
*/
@MustBeDocumented
@Target(AnnotationTarget.ANNOTATION_CLASS)
@Retention(AnnotationRetention.BINARY)
@ExperimentalSerializationApi
Expand Down Expand Up @@ -254,6 +258,7 @@ public annotation class SerialInfo
* fun foo(): Int = Derived.serializer().descriptor.annotations.filterIsInstance<A>().single().value
* ```
*/
@MustBeDocumented
@Target(AnnotationTarget.ANNOTATION_CLASS)
@Retention(AnnotationRetention.BINARY)
@ExperimentalSerializationApi
Expand Down