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

Bugfix/odata error python #1990

Merged
merged 5 commits into from
Nov 23, 2022
Merged

Bugfix/odata error python #1990

merged 5 commits into from
Nov 23, 2022

Conversation

samwelkanda
Copy link
Contributor

@samwelkanda samwelkanda commented Nov 22, 2022

  1. Fixes instantiation error in ODataError class due to wrong inherited class.
#previously  
class ODataError(a_p_i_error.APIError):

# after fix
class ODataError(APIError):
  1. Passes the right class to errorMapping dictionary

@samwelkanda samwelkanda self-assigned this Nov 22, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

66.7% 66.7% Coverage
0.0% 0.0% Duplication

@samwelkanda samwelkanda merged commit f278b73 into main Nov 23, 2022
@samwelkanda samwelkanda deleted the bugfix/odata-error-python branch November 23, 2022 08:54
@@ -289,7 +289,7 @@ private static void WriteQueryParametersMapper(CodeMethod codeElement, CodeClass
writer.WriteLine($"{errorMappingVarName}: Dict[str, ParsableFactory] = {{");
writer.IncreaseIndent();
foreach(var errorMapping in codeElement.ErrorMappings) {
writer.WriteLine($"\"{errorMapping.Key.ToUpperInvariant()}\": o_data_error.{errorMapping.Value.Name}.get_from_discriminator_value(),");
writer.WriteLine($"\"{errorMapping.Key.ToUpperInvariant()}\": o_data_error.{errorMapping.Value.Name},");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting a bit late here but I'm worried that this hardcoded namespace name will throw out of balance generation for clients that are not for odata based APIs?

Assert.Contains("\"4XX\": o_data_error.Error4XX.get_from_discriminator_value()", result);
Assert.Contains("\"5XX\": o_data_error.Error5XX.get_from_discriminator_value()", result);
Assert.Contains("\"403\": o_data_error.Error403.get_from_discriminator_value()", result);
Assert.Contains("\"4XX\": o_data_error.Error4XX", result);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded namespace name

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

Successfully merging this pull request may close these issues.

3 participants