Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andrueastman opened this issue Sep 12, 2024 · 0 comments · Fixed by #5496
Closed
Assignees
Labels
type:bug A broken experience TypeScript Pull requests that update Javascript code WIP
Milestone

Comments

@andrueastman
Copy link
Member

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_
@andrueastman andrueastman added type:bug A broken experience status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Sep 12, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Sep 12, 2024
@andrueastman andrueastman changed the title Incorrect type name and factory method name generation in aliased scenario [TS] Incorrect type name and factory method name generation in aliased scenario Sep 12, 2024
@msgraph-bot msgraph-bot bot added the TypeScript Pull requests that update Javascript code label Sep 12, 2024
@andrueastman andrueastman removed the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Sep 12, 2024
@andrueastman andrueastman moved this from Needs Triage 🔍 to Todo 📃 in Kiota Sep 12, 2024
@andrueastman andrueastman added this to the Kiota v1.19 milestone Sep 12, 2024
@andrueastman andrueastman self-assigned this Sep 30, 2024
@andrueastman andrueastman moved this from Todo 📃 to In Progress 🚧 in Kiota Sep 30, 2024
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Done ✔️ in Kiota Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience TypeScript Pull requests that update Javascript code WIP
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant