Skip to content

[TS] Incorrect type name and factory method name generation in aliased scenario #5404

Closed

Description

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Source Build

Client library/SDK language

TypeScript

Describe the bug

Taking a look at the latest beta generation of the TS sdk at microsoftgraph/msgraph-beta-sdk-typescript#169

The build is failing to pass linting check.

The error points to code at
https://github.com/microsoftgraph/msgraph-beta-sdk-typescript/blob/2c4f2af6489b24580d961764fff3b8d60868ed3d/packages/msgraph-beta-sdk/models/networkaccess/index.ts#L2148

"device": n => { networkAccessTraffic.device = n.getObjectValue<I353170b9ab043a51be0a29bf9ffeadaa40f51ff6511c066ae82d223c77decf60>(CreateDeviceFromDiscriminatorValue); },

Expected behavior

At first glance, the issues look to be

  • The type parameter passed to getObjectValue is incorrect. It should be a type. Instread its passing the alias of a function.
  • The parameter CreateDeviceFromDiscriminatorValue is incorrect. Instead it should be the aliased import.

How to reproduce

Run kiota with the latest graph metadata

Open API description file

https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/beta/openapi.yaml

Kiota Version

main

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

No response

Known Workarounds

No response

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

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

Metadata

Assignees

Labels

TypeScriptPull requests that update Javascript codeWIPtype:bugA broken experience

Type

No type

Projects

  • Status

    Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions