Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.62k stars 822 forks source link

Partial data of private endpoints when trying to fetch static web sites #21573

Open doron276 opened 1 year ago

doron276 commented 1 year ago

Go version 1.20.5

I'm using version:

But it also happens in the latest version:

I'm trying to fetch Azure static web sites using staticWebAppsClient.ListComplete(ctx) I get the objects but they have partial data for private endpoints (the properties field is empty).

{
   "id": "my-static-web-site-id",
   "name": "my-static-web-site-name",
   "properties": {
      "privateEndpointConnections":[
      {
         "name":"private-endpoint-name",
         "properties":{}, // MISSING
      },
      ]
   }
}

When I try to get the data in the same call using the API I get all the data.

I tried to fetch the private endpoints separately using staticWebAppsClient.GetPrivateEndpointConnectionListComplete(ctx)and I succeed to fetch all the data of private endpoints.

I noticed that the types are different with each call:

And during Unmarshall some of the data will be lost (without raising an error). For example you can try debug ByUnmarshallingJSON to see that the data returned from the API is correct and will be lost during the Unmarshall.

Please advise and fix it. Thanks

raych1 commented 1 year ago

@doron276 , the defect in the swagger cause the generation code has issues when doing unmarshal. The model definition of RemotePrivateEndpointConnection is incorrect in the swagger. It has additional layer of properties. The line#4243 to line#4246 and line#4266 need to be deleted in the above swagger.

+@naveedaz @Azure/azure-app-service-control-plane can you fix the swagger in next version? I think this issue happens for other languages of SDK too.

github-actions[bot] commented 1 year ago

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

doron276 commented 1 year ago

Hi @raych1 @naveedaz, Thanks for the answer. We're waiting for your fix. Please advise ASAP. Thanks