You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the same REST API definition and generation command as in #1996, it appears that Kiota generates incorrect code to retrieve the original name of the "api-version" query parameter, which in the client library has been renamed to "api_version". The get_query_parameter method of the SortAndFilterRequestBuilderGetQueryParameters is supposed to return the original name for a given query parameter name, but the code it produces uses the wrong casing for "api-version":
if original_name == "apiVersion": # this should be "api_version"
return "api%2Dversion"
return original_name
The result is that the wrong query parameter name is used in the request and it results in a 400 response.
The text was updated successfully, but these errors were encountered:
Hey @mikekistler
Thanks for reporting this.
Just to be clear, this is supposed to match the "property" name on the query parameters class. What's the property name?
The property name in the query parameters class is "api_version".
@dataclass
class SortAndFilterRequestBuilderGetQueryParameters():
"""
Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.
"""
# API version
api_version: Optional[str] = None
Using the same REST API definition and generation command as in #1996, it appears that Kiota generates incorrect code to retrieve the original name of the "api-version" query parameter, which in the client library has been renamed to "api_version". The
get_query_parameter
method of theSortAndFilterRequestBuilderGetQueryParameters
is supposed to return the original name for a given query parameter name, but the code it produces uses the wrong casing for "api-version":The result is that the wrong query parameter name is used in the request and it results in a 400 response.
The text was updated successfully, but these errors were encountered: