[Python] Autorest generates a method signature with twice the same parameter
See original GitHub issueThis creates invalid code:
def resend_request_emails(
self, resource_group_name, name, name=None, custom_headers=None, raw=False, **operation_config):
"""Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
:param resource_group_name: Name of the resource group to which the
resource belongs.
:type resource_group_name: str
:param name: Certificate order name
:type name: str
:param name: Name of the object.
:type name: str
Based on the docstring, it seems there is two differents objects that wants the same parameter name, but obviously it not possible.
Generated with latest Autorest (20170114) and WebApp composite client. Method is here:
"parameters": [
{
"$ref": "#/parameters/resourceGroupNameParameter"
},
{
"name": "name",
"in": "path",
"description": "Certificate order name",
"required": true,
"type": "string"
},
{
"name": "nameIdentifier",
"in": "body",
"description": "Email address",
"required": true,
"schema": {
"$ref": "#/definitions/NameIdentifier"
}
},
...
"NameIdentifier": {
"description": "Identifies an object.",
"type": "object",
"properties": {
"name": {
"description": "Name of the object.",
"type": "string"
}
}
},
Python code is here.
Autorest cmd line: mono /tmp/tmpwl8glpmr/autorest/tools/AutoRest.exe -i /git-restapi/arm-web/compositeWebAppClient.json -o /tmp/tmpwl8glpmr/compositeWebAppClient.json -AddCredentials True -CodeGenerator Azure.Python -Header MICROSOFT_MIT_NO_VERSION -Modeler CompositeSwagger -Namespace azure.mgmt.web -PackageVersion 0.31.0 -ft 2
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
autorest/readme.md at main - extensions - GitHub
After using the "x-ms-parameter-location": "method" extension the generated client will have a method that looks like this: Notice that resourceGroupName is the ...
Read more >Why can't two methods be declared with the same signature ...
I get a compile error that states that the class already defines a member with the same parameter types. (Obviously the way I'm...
Read more >Generating Clients with AutoRest - Azure documentation
This guide tells you how to generate code from your OpenAPI definition using AutoRest. We'll take this incrementally, working on first how to...
Read more >Generating clients for your APIs with AutoRest
They've created and open sourced a tool called [AutoRest](https://github.com/Azure/autorest) that can generate client side code from the Swagger document ...
Read more >How to use AutoRest with RDP - Refinitiv Developer Community
AutoRest Overview. AutoRest is an OpenAPI (Swagger) specification code generator. It is an open-source tool generating client libraries for accessing RESTful ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah. Ok, that’ll help.
Back on it!
This would have been handled in the core; duplicate names get disambiguated pretty early.
I think that it’s sneaking by because of auto flattening which happens later. (which happens quite a bit later. )
I’m going to have to debug into this and see why it’s not getting caught when the params are added back into the collection.