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

Array xmlns encoding/decoding #2309

Merged
merged 5 commits into from
Nov 17, 2023
Merged

Conversation

MarkusHorstmann
Copy link
Contributor

Proposed changes

XmlEncoder.WriteArray and XmlDecoder.ReadArray always use the OPC UA XML namespace (http://opcfoundation.org/UA/2008/02/Types.xsd) for the field element that contains the array, regardless of the namespace that the caller may have pushed.

Related Issues

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

@MarkusHorstmann MarkusHorstmann changed the title Array xmlns Array xmlns encoding/decoding Sep 15, 2023
@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (37252f3) 53.27% compared to head (15bb119) 53.61%.

Files Patch % Lines
Stack/Opc.Ua.Core/Types/Encoders/XmlEncoder.cs 58.49% 17 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2309      +/-   ##
==========================================
+ Coverage   53.27%   53.61%   +0.33%     
==========================================
  Files         331      331              
  Lines       63816    63811       -5     
  Branches    13100    13098       -2     
==========================================
+ Hits        34001    34210     +209     
+ Misses      26065    25874     -191     
+ Partials     3750     3727      -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mregen
Copy link
Contributor

mregen commented Oct 19, 2023

                    PushNamespace(Namespaces.OpcUaXsd);

does this also have to be removed?


Refers to: Stack/Opc.Ua.Core/Types/Encoders/XmlEncoder.cs:2118 in a9cc81b. [](commit_id = a9cc81b, deletion_comment = False)

@MarkusHorstmann
Copy link
Contributor Author

                    PushNamespace(Namespaces.OpcUaXsd);

does this also have to be removed?

Refers to: Stack/Opc.Ua.Core/Types/Encoders/XmlEncoder.cs:2118 in a9cc81b. [](commit_id = a9cc81b, deletion_comment = False)

Not seeing a PushNamespace at this line. Which method is it in? I did double check all PushNamespace calls in XmlEncoder.cs and they all seem to be correct (before reading an element defined by a core type).

@opcfoundation-org
Copy link
Contributor

I am concerned the fix addresses the issue with arrays nested within a type but it may break top level arrays.

@mregen mregen added this to the 1.4.372 November updates milestone Oct 25, 2023
@EthanChangAED EthanChangAED assigned mrsuciu and mregen and unassigned mrsuciu Nov 14, 2023
Copy link
Contributor

@mregen mregen left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!
upon discussion today in the user group this PR is approved.

@mregen
Copy link
Contributor

mregen commented Nov 16, 2023

@MarkusHorstmann please resolve the merge conflict.

@MarkusHorstmann
Copy link
Contributor Author

@MarkusHorstmann please resolve the merge conflict.

Done. The test failures don't seem to be related to my changes. Please let me know if you think otherwise.

@mregen mregen merged commit eeea34f into OPCFoundation:master Nov 17, 2023
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XmlEncoder/Decoder always use the OPC UA XML namespace for the containing field of a one-dimensional array
4 participants