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

wire-grade-plugin strips deprecated option from EnumTypes #3075

Open
aaron-edwards opened this issue Aug 19, 2024 · 1 comment
Open

wire-grade-plugin strips deprecated option from EnumTypes #3075

aaron-edwards opened this issue Aug 19, 2024 · 1 comment

Comments

@aaron-edwards
Copy link
Contributor

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),
  ;

...
@oldergod
Copy link
Member

oldergod commented Sep 2, 2024

Thanks for the fix! Is there anything to do for this ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants