KsMethodMetadata

annotation class KsMethodMetadata

Meta-annotation that marks an annotation class as a sibling of KsMethod whose arguments should be captured by the ksrpc compiler plugin and propagated into the generated RpcMethod descriptor.

Apply this to an annotation class to opt it in to compiler-driven metadata propagation. Only annotations applied to functions also annotated with KsMethod are captured. The arguments of qualifying annotations are stored as MethodMetadata on the generated RpcMethod, where transport layers can read them at serialize time.

The annotation arguments must be of supported metadata-value types: primitives (String, Int, Long, Boolean, Double, Float), KClass references, enum values, or arrays/lists thereof. Nested annotation values are not supported.

For forward compatibility, an older version of ksrpc reading a descriptor generated by a newer version sees unknown sibling annotations as opaque MethodMetadata entries — they remain queryable by FQ name without requiring the unknown annotation class on the classpath.