-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[core-client] x-www-form-urlencoded parameters not serialized #14767
Comments
What is the workaround that is being used at the moment? |
azure-sdk-for-js/sdk/containerregistry/container-registry/src/containerRegistryTokenCredential.ts Lines 110 to 130 in 67a3401
|
The generated ACR operation spec: azure-sdk-for-js/sdk/containerregistry/container-registry/src/generated/operations/authentication.ts Lines 78 to 93 in 45a3fd3
In serialization policy
request.formData["path1.aadAccesstoken"] = { grant_type: 'access_token', service: 'myregistry.azurecr.io' } while I'd expect form data to be request.formData["grant_type"] = "access_token";
request.formData["service"] = "myregistry.azurecr.io"; |
@sarangan12 @joheredi do you know whether this is expected generated code? I looked at other languages but couldn't find similar things. They seems to just use form content (Python) or encoded content (.NET), |
Looking at the spec (provided in the first issue description), the
I am not clear about the reasoning about the expectation:
Could you please explain a little more? |
This is what the service actually expects, which suggests that for form data, the parameter path For application/x-www-form-urlencoded content type, I'd expect a list of name-value string pairs, and they would be url encoded, each pair connected with "=" and all of them concatenated with "&" as delimitor. like "grant_type=access_token&service=myregistry.azurecr.io" I wonder whether .NET or Python code gen have any special handling for form data parameters. Right now one idea for fixing in core is to
but I am still trying to understand the problem. |
kinda of related to #16007. It would be nice if we could generate parameters for form parameters for |
Not sure what has changed in the codegen since this is logged. But now the generated code is different so this might not be an issue any more. formDataParameters: [
Parameters.service,
Parameters.scope,
Parameters.refreshToken1,
Parameters.grantType1
], |
Fixed by #18560 |
Some ACR generated methods use
application/x-www-form-urlencoded
to send request. Currently an error is thrown when using those generated methods.Here's new unit test that represents the scenario.
The text was updated successfully, but these errors were encountered: