Open
Description
Describe the bug
In todoApp, we have noAuth
decorated on the namespace Users
@useAuth(NoAuth)
namespace Users { }
the generated ./src/api/usersClient/usersClientContext.ts file should pass undefined to getClient instead of an undefine credential
export function createUsersClientContext(
endpoint: string,
options?: UsersClientOptions,): UsersClientContext {
const params: Record<string, any> = {
endpoint: endpoint
};
const resolvedEndpoint = "{endpoint}".replace(/{([^}]+)}/g, (_, key) =>
key in params ? String(params[key]) : (() => { throw new Error(`Missing parameter: ${key}`); })()
- );;return getClient(resolvedEndpoint,credential,{
+ );;return getClient(resolvedEndpoint,undefined,{
...options,
})
}
Reproduction
https://github.com/allenjzhang/typespec-e2e-demo/tree/main/todoApp/spec
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.