Skip to content

escapeKotlinKeywords = true not using right property name in toString #3674

Description

@bjoernmayer

The Proto

message JwtLocation {
  oneof in {
    string header = 1;
    string query = 2;
    string cookie = 4;
  }

  string value_prefix = 3;
}

with wire config

escapeKotlinKeywords = true 

// And. not sure if this influences this:
oneofMode = "sealed_class"

results in this wrong toString()

override fun toString(): String {
    val result = mutableListOf<String>()
    if (`in` != null) result += """in=$in"""
    result += """value_prefix=${sanitize(value_prefix)}"""
    return result.joinToString(prefix = "JwtLocation{", separator = ", ", postfix = "}")
  }

Should be

override fun toString(): String {
    val result = mutableListOf<String>()
    if (`in` != null) result += """in=$`in`"""
    result += """value_prefix=${sanitize(value_prefix)}"""
    return result.joinToString(prefix = "JwtLocation{", separator = ", ", postfix = "}")
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions