Azure / cadl-ranch

Cadl Scenarios for client generations
https://azure.github.io/cadl-ranch/
MIT License
8 stars 32 forks source link

bug in versioning/removed/mockapi.ts case #734

Open weidongxu-microsoft opened 2 months ago

weidongxu-microsoft commented 2 months ago

Request should be correct to versioning/removed/api-version:v2preview/v3 with enumMemberV2Preview. But rejected by mockapi

[ForkJoinPool-1-worker-1] INFO com.versioning.removed.implementation.RemovedClientImpl$RemovedClientService.modelV3Sync - {"az.sdk.message":"HTTP request","method":"POST","url":"http://localhost:3000/versioning/removed/api-version:v2preview/v3","tryCount":1,"Date":"Mon, 30 Sep 2024 02:10:20 GMT","Content-Type":"application/json","x-ms-client-request-id":"5d87308e-055b-45fa-83a4-e375c4f8d42d","Accept":"application/json","User-Agent":"azsdk-java-${project.artifactId}/${project.version} (21.0.3; Windows 11; 10.0)","content-length":45,"body":"{\"id\":\"123\",\"enumProp\":\"enumMemberV2Preview\"}"}
[ForkJoinPool-1-worker-1] INFO com.versioning.removed.implementation.RemovedClientImpl$RemovedClientService.modelV3Sync - {"az.sdk.message":"HTTP response","statusCode":400,"url":"http://localhost:3000/versioning/removed/api-version:v2preview/v3","durationMs":6,"content-length":160,"Date":"Mon, 30 Sep 2024 02:10:20 GMT","Connection":"keep-alive","ETag":"W/\"a0-7pCSm5UxU05anpeENBbPPWfTNCY\"","Content-Type":"application/json; charset=utf-8","redactedHeaders":"Keep-Alive,X-Powered-By","content-length":160,"body":"{\"message\":\"Body provided doesn't match expected body\",\"expected\":{\"id\":\"123\",\"enumProp\":\"enumMemberV1\"},\"actual\":{\"id\":\"123\",\"enumProp\":\"enumMemberV2Preview\"}}"}

com.azure.core.exception.HttpResponseException: Status code 400, "{"message":"Body provided doesn't match expected body","expected":{"id":"123","enumProp":"enumMemberV1"},"actual":{"id":"123","enumProp":"enumMemberV2Preview"}}"
weidongxu-microsoft commented 2 months ago

Commented by Crystal, the expected request body should only include id=123, no enumProp as it is removed in v2preview.