Skip to content

Generated TS Client has missing import #6884

Closed

Description

@AlexanderFinkbeiner

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

Csharp

Describe the bug

I generated in my dotnet api with FastEndpoints.ClientGen.Kiota Version 7.0.1 a typescript client. It generates this file that is missing an import of an enum object:

Image

Expected behavior

The import should be also include the enum object:
import { UserAppGroup, UserAppGroupObject } from '../../../../../../models/index.js';

How to reproduce

app.UseFastEndpoints(c =>
{
    c.Endpoints.ShortNames = true;
    c.Serializer.Options.Converters.Add(new JsonStringEnumConverter());
})
.UseSwaggerGen();

Open API description file

  "/api/me/apps/{appId}/group/{group}": {
      "patch": {
        "tags": [
          "Api"
        ],
        "operationId": "SetGroupForAppEndpoint",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "group",
            "in": "path",
            "required": true,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/UserAppGroup"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAppGroup"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },

"UserAppGroup": {
"type": "string",
"description": "",
"x-enumNames": [
"Standard",
"Favorite",
"Archived"
],
"enum": [
"Standard",
"Favorite",
"Archived"
]
},

Kiota Version

1.28.0+57130b1b1db3bc5c060498682f41e20c8ae089f2

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

``

Configuration

  • OS: Windows 11
  • architecture: x94

Debug output

Click to expand log ```
</details>


### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    CsharpPull requests that update .net codetype:bugA broken experience

    Type

    No type

    Projects

    • Status
      Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions