Skip to content

fix issues in todo: anonymous array model import and sample mock value for credential#2342

Merged
qiaozha merged 10 commits intoAzure:mainfrom
qiaozha:try-fix-anonymous-model-import
Mar 13, 2024
Merged

fix issues in todo: anonymous array model import and sample mock value for credential#2342
qiaozha merged 10 commits intoAzure:mainfrom
qiaozha:try-fix-anonymous-model-import

Conversation

@qiaozha
Copy link
Copy Markdown
Member

@qiaozha qiaozha commented Mar 9, 2024

fixes #2326
fixes #2330

@qiaozha qiaozha marked this pull request as ready for review March 11, 2024 05:53
@qiaozha qiaozha changed the title fix anonymous array model import fix issues in todo: anonymous array model import and sample mock value for credential Mar 11, 2024
Comment thread packages/typespec-ts/src/utils/modelUtils.ts
Copy link
Copy Markdown
Member

@MaryGao MaryGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and just small comments.

} else {
clientParams.push({
name: "credential",
assignment: `const credential = {getToken: () => Promise.resolve({ token: "{Your token}", expiresOnTimestamp: 0 })};`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joheredi I wonder if you have any concerns for this part for generating the mock value for token credential as we don't have @azure/identity in non-branded scope.

) {
clientParams.push({
name: "credential",
assignment: `const credential = { key: "{Your API key}"};`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also for the KeyCredential mock value here.

@qiaozha
Copy link
Copy Markdown
Member Author

qiaozha commented Mar 13, 2024

I will merge it for now, @joheredi let me know if you have any concerns.

@qiaozha qiaozha merged commit 2ccb67c into Azure:main Mar 13, 2024
@qiaozha qiaozha deleted the try-fix-anonymous-model-import branch March 13, 2024 01:27
@qiaozha qiaozha mentioned this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mock value for key credential is missing in sample generation fail to import array value type if it's inside a anonymous body type

2 participants