Skip to content
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

[datafactory@2018-06-01]: webactivities.headers struct changed #381

Open
ziyeqf opened this issue Feb 18, 2024 · 3 comments
Open

[datafactory@2018-06-01]: webactivities.headers struct changed #381

ziyeqf opened this issue Feb 18, 2024 · 3 comments

Comments

@ziyeqf
Copy link
Contributor

ziyeqf commented Feb 18, 2024

affected file: https://github.com/tombuildsstuff/kermit/blob/main/sdk/datafactory/2018-06-01/datafactory/models.go
the struct used to be interface{}

Headers interface{} `json:"headers,omitempty"`

but a string map now:

Headers map[string]*string `json:"headers"`

while my testing results shows the response from the service is not map[string]string format:

  1. edit on Portal, add an expression to the header
  2. call GET on the resource
    the headers in the response is :
                    "headers": {
                        "authorization": {
                            "type": "Expression",
                            "value": "@pipeline().parameters.test"
                        },
                        "content_type": "application/x-www-form-urlencoded"
                    }

It broke users' existing resources: hashicorp/terraform-provider-azurerm#24758

Noticed there was a Swagger change: Azure/azure-rest-api-specs@97cefc8#diff-d5aa9217e2132932fec24cba8c2a103430c34ed925739a4529a0acd16483803aR8246

I'm assuming the sdk change was caused by the Swagger change, so an issue on the rest api is also opened: Azure/azure-rest-api-specs#27816

@tombuildsstuff
Copy link
Owner

@ziyeqf this looks like a case of an invalid Swagger definition - the Swagger extension being used there (x-ms-format) isn't valid i.e. defined in the list of autorest extensions?

Based on the naming here containing dfe (datafactory extension?) - is this a DataFactory specific extension? It's previous value prior to this change appears to have been ignored - and it's undocumented, so it's unclear what the behavioural expectation is for this field?

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Apr 1, 2024

@ziyeqf this looks like a case of an invalid Swagger definition - the Swagger extension being used there (x-ms-format) isn't valid i.e. defined in the list of autorest extensions?

Based on the naming here containing dfe (datafactory extension?) - is this a DataFactory specific extension? It's previous value prior to this change appears to have been ignored - and it's undocumented, so it's unclear what the behavioural expectation is for this field?

By digging into the autorest.csharp repo I think I understood a bit of x-ms-format and dfe-*....
It seems your assumption is correct, x-ms-format is a superset of format, added some extension.
And the dfe- prefix is used to invovle the data factory dependency into generated csharp project..
I'm not sure about these conclusion... This extension is not documented and I suspect it targets on the dotnet sdk.

Some references:

  1. https://github.com/Azure/autorest.csharp/blob/139b9cc94af38f61081d0ad07e2f0e4fc47764e8/src/AutoRest.CSharp/Common/Input/CodeModelPartials.cs#L186C27-L186C36
  2. https://github.com/Azure/autorest.csharp/pull/2852/files#diff-17a28f89f3725d0ef8e50ca8efa027a425f0293377e7f8862c25b751868827b6
  3. https://github.com/Azure/autorest.csharp/blob/139b9cc94af38f61081d0ad07e2f0e4fc47764e8/src/AutoRest.CSharp/Common/Generation/Types/TypeFactory.cs#L337
  4. https://github.com/Azure/autorest.csharp/blob/139b9cc94af38f61081d0ad07e2f0e4fc47764e8/src/AutoRest.CSharp/Common/Input/CodeModelConverter.cs#L444

@tombuildsstuff
Copy link
Owner

@ziyeqf indeed, thanks for the link to the C# SDK - I was chatting with @stephybun about this one recently as a part of getting the Data Factory items into hashicorp/go-azure-sdk - I've opened hashicorp/pandora#4026 to track fixing this in Pandora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants