Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.21k forks source link

[ai-vision-image-analysis] README sample issues #31491

Open jeremymeng opened 1 month ago

jeremymeng commented 1 month ago

It looks that the samples are copied from C#? For Rest Level Client (RLC) we don't have constructors to create client instances. We use the factory/builder method instead. Looks that the package has correct samples, but the example snippets are untested and wrong. For example,

https://github.com/Azure/azure-sdk-for-js/blob/31b76c94f5bb633dfa73fe9c20d1ba88a0e9228e/sdk/vision/ai-vision-image-analysis-rest/README.md#L86

Sample snippets in README.md should be valid and are expected to work with minimal effort after copying and pasting them into a project.

To get the benefits of build and run samples, please refer to template package for how we could use a snippets.spec.ts and the dev-tool's update-snippets command

https://github.com/Azure/azure-sdk-for-js/blob/31b76c94f5bb633dfa73fe9c20d1ba88a0e9228e/sdk/template/template/test/snippets.spec.ts#L10

https://github.com/Azure/azure-sdk-for-js/blob/31b76c94f5bb633dfa73fe9c20d1ba88a0e9228e/sdk/template/template/README.md#L78

https://github.com/Azure/azure-sdk-for-js/blob/31b76c94f5bb633dfa73fe9c20d1ba88a0e9228e/sdk/template/template/package.json#L59

github-actions[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dargilco @rhurey.