-
Notifications
You must be signed in to change notification settings - Fork 0
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
Remove namespace redundancy when generating json #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, what a simple fix! I actually spent some time to understand its cleverness and think it is suitable for our use case 👍
While checking the code, I also came up with a test for a bidirectional test -- it simply checks whether the XML -> JSON -> XML conversation (or JSON -> XML -> JSON) is performed without any change: bidirectional_converter_spec.rb.zip
I would propose adding it as well to our test suite -- just to be sure that a similar mistake cannot slip in again.
Thanks for the feedback!
Do you think it fits in the scope of this PR? I don't see any direct ties. |
Somewhat. The tests I provided wouldn't pass without your change, so that they cannot be added earlier. However, as soon as this PR is merged, it can be added at any time. I thought it would fit somewhat in the scope of this PR, since this PR resolves an issue that was previously preventing the bidirectional conversion to function correctly. Nevertheless, I am also fine to merge this PR and just open another one with my changes 😁 |
Weird - I tried adding the test directly to main and it works fine for me 😕 |
Codecov Report
@@ Coverage Diff @@
## main #52 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 11 11
Lines 315 315
=========================================
Hits 315 315
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Nonetheless, feel free to commit it to this PR to reduce the overhead |
You're right, I see that as well. Obviously, the issue is with the I'll merge this PR and will open another one with my changes soon. Then, we can continue the discussion there. |
Previously, we might have duplicated namespaces when converting the same string back and forth. With the latest change in #52, we're avoiding this error and are now adding respective test coverage for this phenomena.
Previously, we might have duplicated namespaces when converting the same string back and forth. With the latest change in #52, we're avoiding this error and are now adding respective test coverage for this phenomena.
Previously, we might have duplicated namespaces when converting the same string back and forth. With the latest change in #52, we're avoiding this error and are now adding respective test coverage for this phenomena.
This change adds an additional requirement for a namespace to be added to the namespace attribute in the json format: