-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix Issue In current Versioning\Removed #736
Conversation
🦋 Changeset detectedLatest commit: 2d72382 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@tadelesh Regarding the mockapi added in Version\Removed tests, it does not actually achieve the expected effect. We want the mockapi to perform different validations and return different response bodies for the same operation based on different paths. However, in the code generated by autorest.csharp, the mockapi actually only validates based on the Expect Body of the first path and only returns the response body corresponding to the first path, without handling different paths differently. This has caused a bug. Now I want to know if there is a better solution for this situation. If the mockapi cannot perform corresponding validations and provide return values based on different paths, is there another way to achieve our expected effect? |
there are other test cases which also has multiple paths:
|
This issue has been resolved. It was caused by using : instead of [:] to denote dynamic parameters in multiple paths. As for the resiliency part, since C# currently does not seem to support this feature, the successful execution of the test case does not indicate much. However, the way the mockapi is written is correct. |
@weidongxu-microsoft I have upgraded the PR code according to the new mockapi requirements and have also tested and verified it locally against three versions of the generated code. Please help review. |
* fix * Update main.tsp * update * Update cadl-ranch-summary.md * Update cadl-ranch-summary.md * update * Update mockapi.ts * fix doc * Update mockapi.ts * Update mockapi.ts * Update mockapi.ts
* fix * Update main.tsp * update * Update cadl-ranch-summary.md * Update cadl-ranch-summary.md * update * Update mockapi.ts * fix doc * Update mockapi.ts * Update mockapi.ts * Update mockapi.ts
* fix * Update main.tsp * update * Update cadl-ranch-summary.md * Update cadl-ranch-summary.md * update * Update mockapi.ts * fix doc * Update mockapi.ts * Update mockapi.ts * Update mockapi.ts
Fixed issue that exist in http\versioning\removed.
Related Issue Link: #734