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

Clarify createBotFrameworkAuthenticationFromConfiguration usage in yo templates #4786

Open
rido-min opened this issue Nov 4, 2024 · 0 comments
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@rido-min
Copy link
Member

rido-min commented Nov 4, 2024

The signature of createBotFrameworkAuthenticationFromConfiguration

export function createBotFrameworkAuthenticationFromConfiguration(
configuration: Configuration,
credentialsFactory?: ServiceClientCredentialsFactory,
authConfiguration?: AuthenticationConfiguration,
botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>,
connectorClientOptions: ConnectorClientOptions = {}
): BotFrameworkAuthentication {

does not allow to pass the first parameter as null. However, the code produced by the yo template, calls this method as

const botFrameworkAuthentication = createBotFrameworkAuthenticationFromConfiguration(null, credentialsFactory);

producing a typescript error when using strict: true

Argument of type 'null' is not assignable to parameter of type 'Configuration'.

Expected behavior

The generated code should embrace the public API.
Update the method signature to allow nulls or update the template to avoid this error.

Additional context

This also happens in JS when using @ts-check

@rido-min rido-min added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

1 participant