-
Notifications
You must be signed in to change notification settings - Fork 859
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
Security Center DataExportSettingProperties not unmarshalled properly #12724
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @chlahav. |
HI @beandrad thanks for this issue! Yeah, now I see this API is problematic, if the resource itself is polymorphic, the returned model should have a discriminator. But in this case, the returned model I will possibly have a look at this issue in detail. But I assume to actually fix this, we will have to fix the problematic swagger definition to remove that redundant inheritances. |
I just had a quick test, the returned JSON from the service is
As you can see, this is clearly a And unfortunately we do not have any workaround within the framework of the SDK. I will try to fix this by fixing the swagger, please stay tuned. |
Hi @beandrad I made some experiments refining the inheritance structure in the swaggers and generating new SDK, the following test code:
And it gives you this as expected:
Since we already have an upstream issue tracking this, I will then close this issue. Please stay tuned and I will release a new version as soon as the swagger is fixed. Thanks! |
Well, I decide to reopen this and close this from the new release PR. |
Thanks for looking into it @ArcturusZhang! :) |
Bug Report
Setting is returned by the Get function and it cannot be cast to DataExportSettingProperties since this returns an error or by calling AsDataExportSettings() since this returns nil.
Regarding the Azure API specs, Settinghttps://github.com/Azure/azure-rest-api-specs/blob/27cc07ddd294d98e05cb301e07a72378df9f87e8/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json#L175 is of type SettingResource has a field (
kind
) defined as discriminator, which makesSettingResource
polymorphic.What did you expect or want to happen?
I'd expect to be able to Get to
DataExportSettings
when the kind field in the Get response isDataExportSettings
.Related issue: Add
Enabled
to ASC setting resource #12687The text was updated successfully, but these errors were encountered: