-
Notifications
You must be signed in to change notification settings - Fork 216
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
Cannot find name 'createStringFromDiscriminatorValue' when generating typescript #4018
Comments
Hi @sword-jin, |
@baywet |
The error mapping is most likely a bug yes. For the error mapping issue, would you be willing to submit a pull request? This is most likely caused by the fact that these conditions are not properly built: kiota/src/Kiota.Builder/KiotaBuilder.cs Line 1293 in 95a6c2a
The call to And you can add a unit test by copying this one
|
After I changed the logic like you described, {
codeClass.IsErrorDefinition = true;
executorMethod.AddErrorMapping(errorCode, errorType);
}
if (errorType != null)
logger.LogWarning("Could not create error type for {Error} in {Operation}", errorCode, operation.OperationId); there is no |
no worries, just authored #4026 to address this issue. |
I see, please inform me after you create a new tag, I will test it by latest docker image. |
On the nightly tag we have a preview going out every Thursday afternoon, Eastern Time. |
@baywet , why didn't push a release last week? I am waiting for this bug fix |
@sword-jin we had a code-sign certificate expire last week unfortunately. Thank you for your patience while we work to renew it and unblock releases. |
Please release once manually if it's possible. 🙂 |
I feel there is still a bug here I am using latest pacakges:
|
Also, there is no errorMapping in the
I am still using the original openapi.yaml in this issue description. |
Can you open a separate issue for the multi part thing please? Yes this is expected for your description, since the error being described is only a string, kiota can't generate a type that's both a string AND inherits from ApiException (so it can be thrown) |
Sure, for error in this PR microsoft/kiota-typescript#1053 |
openapi yaml like:
the generated code is using
createStringFromDiscriminatorValue
which is not imported and not found in theitem/index.ts
I guess the correct one is createMessageFromDiscriminatorValue
The text was updated successfully, but these errors were encountered: