-
Notifications
You must be signed in to change notification settings - Fork 618
fix(clients): only trim xml tag values which contain newline #2653
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
Conversation
Debugged with a specific test case Ec2InvalidGreetingError:Error:GreetingWithErrors
Failed: "Expected a InvalidGreeting to be thrown, got TypeError instead"
368 | if (err.name !== "InvalidGreeting") {
369 | console.log(err);
> 370 | fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`);
| ^
371 | return;
372 | }
373 | const r: any = err;
at Env.fail (../../node_modules/jest-jasmine2/build/jasmine/Env.js:722:61)
at Object.<anonymous>.it (tests/functional/ec2query.spec.ts:370:7) The parsedObj from xmlParse operation:
{
"Response": {
"Errors": {
"Error": {
"Code": "InvalidGreeting",
"Message": "Hi"
}
},
"RequestId": "foo-id"
}
}
{
"Response": {
"#text": "\n \n \n ",
"Errors": {
"#text": "\n \n ",
"Error": {
"#text": "\n \n \n ",
"Code": "InvalidGreeting",
"Message": "Hi"
}
},
"RequestId": "foo-id"
}
} |
PR which introduced logic to read contents from |
Requirement: Preserve whitespace values only if they are inside a tag, and not if they appear prior to child tag. For example, the XML value being returned in protocol_test is: <?xml version = "1.0" encoding = "UTF-8"?>
<SimpleScalarPropertiesInputOutput>
<stringValue> </stringValue>
</SimpleScalarPropertiesInputOutput> When trimming is disabled, the parsed output is: {
"SimpleScalarPropertiesInputOutput": { "#text": "\n \n ", "stringValue": " " }
} When trimming is enabled, the parsed output is: { "SimpleScalarPropertiesInputOutput": { "stringValue": "" } } The output we want: { "SimpleScalarPropertiesInputOutput": { "stringValue": " " } } |
Codecov Report
@@ Coverage Diff @@
## main #2653 +/- ##
=======================================
Coverage ? 60.64%
=======================================
Files ? 516
Lines ? 27774
Branches ? 6825
=======================================
Hits ? 16844
Misses ? 10930
Partials ? 0 Continue to review full report at Codecov.
|
772be46
to
95e0e4c
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This is approved because the condition of triming the value is stricter than before. But we do need to confirm weather this is a valid test case, should remove the value node from wire response? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
Internal JS-2756
Description
Do not trim values while parsing XML
Testing
Protocol tests
Additional context
Follow-up to #2646
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.