Skip to content

Multi-level nested type definitions in API lose hierarchy information when generating TypeScript files #5402

@liuqiandev

Description

@liuqiandev

Describe the bug
When using multi-level nesting in type definitions in the API, the hierarchy information is lost when generating TypeScript files.

Original (原文): 在api中定义type时使用了多级嵌套,在生成ts文件时,导致层级丢失了层级信息

To Reproduce

  1. API definition:

    Original (原文): api中的定义

    type (
     IdStruct {
         Id int64 `json:"id"`
     }
     NameStrcut {
         IdStruct
         Name string `json:"name"`
     }
     AgeStruct {
         NameStrcut
         Age int `json:"age"`
     })
    
  2. Generated frontend code loses the first level IdStruct information:

    Original (原文): 生成的前端代码,丢失了第一层的IdStruct信息

    export interface AgeStruct {
     name: string
     age: number}
    

Environments (please complete the following information):

  • goctl version 1.9.2

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