Skip to content

Issue with protoc-gen-es when using hyphens in json_name #995

Closed
@nicole0707

Description

Describe the bug

When using protoc-gen-es with json_types=true option, if the value of json_name includes a hyphen(e.g. "x-id"), it causes errors in the generated Typescript or Javascript files.

To Reproduce

 /**
   * @generated from field: string x_id = 101 [json_name = "x-id"];
   */
  x-id?: string;

Additional context
The generated code should correctly handle the hyphen without causing syntax errors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions