Skip to content

BUG: Field containing number are are inconsistent with proto JSON Mapping done by gateway #52

@zoido

Description

@zoido

When the message filed contains number it's name in the generated typescript is not consistent with the JSON Mapping done by the grpc-gateway runtime. See example below.

Example input message:

syntax = "proto3";

package example.v1;

message Example { string k8s_field = 1; }

Result:

/* eslint-disable */
// @ts-nocheck
/*
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
*/
export type Example = {
  k8SField?: string
}

Expected result

export type Example = {
  k8sField?: string
}

Generator uses fieldName function that effectively uses strcase.ToLoweCamel that also uppers the case of characters after any number.

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