swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
Reusing a name in and out of a function is referred to as "name shadowing." Python happens to have already something named 'range' https://docs.python.org/3/library/stdtypes.html?highlight=range#range. Shadowing is not a syntax error, but working around the name conflict makes the code less readable.
In the files generated, search for a lines containing 'def get_item_feed'. On MacOS or Unix you could run grep.
grep -R 'def get_item_feed'
Note that the following line of code contains the parameter name 'range'.
def get_item_feed(self, accept, x_ebay_c_marketplace_id, range, feed_scope, category_id, **kwargs): # noqa: E501
Related issues/PRs
Unknown, unable to find any.
Suggest a fix/enhancement
When a parameter name is 'range,' perhaps prefix or suffix it with an underscore '_.' Although not a keyword, 'range' is part of the Python language. The generated Python code would have a syntax error if a parameter name happened to be a reserved word, https://docs.python.org/3/reference/lexical_analysis.html#keywords, so likely the Python generator already does some parameter renaming.
Description
Reusing a name in and out of a function is referred to as "name shadowing." Python happens to have already something named 'range' https://docs.python.org/3/library/stdtypes.html?highlight=range#range. Shadowing is not a syntax error, but working around the name conflict makes the code less readable.
Swagger-codegen version
3.0.29 stable release
Swagger declaration file content or url
https://developer.ebay.com/api-docs/master/buy/feed/openapi/3/buy_feed_v1_beta_oas3.json
Command line used for generation
/usr/local/bin/swagger-codegen generate -l python -o buy_feed -DpackageName=buy_feed -i https://developer.ebay.com/api-docs/master/buy/feed/openapi/3/buy_feed_v1_beta_oas3.json
Steps to reproduce
Open a command-line terminal.
Run the following command. If not using MacOS, modify this '/usr/local/bin/' part of the command line per your operating system.
/usr/local/bin/swagger-codegen generate -l python -o buy_feed -DpackageName=buy_feed -i https://developer.ebay.com/api-docs/master/buy/feed/openapi/3/buy_feed_v1_beta_oas3.json
In the files generated, search for a lines containing 'def get_item_feed'. On MacOS or Unix you could run grep. grep -R 'def get_item_feed'
Note that the following line of code contains the parameter name 'range'. def get_item_feed(self, accept, x_ebay_c_marketplace_id, range, feed_scope, category_id, **kwargs): # noqa: E501
Related issues/PRs
Unknown, unable to find any.
Suggest a fix/enhancement
When a parameter name is 'range,' perhaps prefix or suffix it with an underscore '_.' Although not a keyword, 'range' is part of the Python language. The generated Python code would have a syntax error if a parameter name happened to be a reserved word, https://docs.python.org/3/reference/lexical_analysis.html#keywords, so likely the Python generator already does some parameter renaming.