wire-grade-plugin strips deprecated option from EnumTypes
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
When generating java and kotlin enums that have the option deprecated = true; flag the resulting enum generated does not contain the @Deprecated annotation. This appears to be due to the pruning functionality not retaining the deprecated flag and only affects the enum classes (enum constants, messages and fields all work as expected)
test/period.proto
syntax = "proto2";
enum Period {
option deprecated = true;
CRETACEOUS = 1;
}
build/Period.kt
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: Period in period.proto
@file:Suppress(
"DEPRECATION",
"RUNTIME_ANNOTATION_NOT_SUPPORTED",
)
import com.squareup.wire.EnumAdapter
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.Syntax.PROTO_2
import com.squareup.wire.WireEnum
import com.squareup.wire.`internal`.JvmField
import com.squareup.wire.`internal`.JvmStatic
import kotlin.Int
import kotlin.Suppress
public enum class Period(
override val `value`: Int,
) : WireEnum {
CRETACEOUS(1),
;
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using test/period.proto and inspect the generated build/Period.kt for the missing @Deprecated annotation. Start by tracing the pruning functionality described in the issue, then verify that deprecated enum options are retained while existing enum constant, message, and field behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100