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

Add IJsonEncoder/IJsonDecoder interfaces #2042

Merged
merged 11 commits into from
Jul 20, 2023
Merged

Add IJsonEncoder/IJsonDecoder interfaces #2042

merged 11 commits into from
Jul 20, 2023

Conversation

mregen
Copy link
Contributor

@mregen mregen commented Jan 7, 2023

Proposed changes

  • in order to abstract the implementation of a IEncoder/IDecoder for Json with some extra methods and properties, derive JsonEncoder/Jsondecoder from a IJsonDecoder/IJsonEncoder interface
  • breaking change: the use of reversible/non-reversible subencoding is handled by a new method:
    void UsingReversibleEncoding<T>(Action<string, T> action, string fieldName, T value, bool useReversibleEncoding)

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.

@mregen mregen marked this pull request as draft January 7, 2023 18:03
@mregen mregen added this to the 1.4.372 milestone Jan 7, 2023
@codecov
Copy link

codecov bot commented Jan 7, 2023

Codecov Report

Merging #2042 (d21458a) into master (c7bd19d) will increase coverage by 13.52%.
The diff coverage is 95.00%.

❗ Current head d21458a differs from pull request most recent head 3bb97ff. Consider uploading reports for the commit 3bb97ff to get more accurate results

@@             Coverage Diff             @@
##           master    #2042       +/-   ##
===========================================
+ Coverage   44.34%   57.86%   +13.52%     
===========================================
  Files         276      324       +48     
  Lines       51605    61498     +9893     
===========================================
+ Hits        22884    35587    +12703     
+ Misses      28721    25911     -2810     
Impacted Files Coverage Δ
Stack/Opc.Ua.Core/Types/Encoders/JsonDecoder.cs 82.61% <ø> (+4.22%) ⬆️
Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs 82.09% <92.85%> (+0.87%) ⬆️
...aries/Opc.Ua.PubSub/Encoding/JsonDataSetMessage.cs 86.86% <100.00%> (ø)
...aries/Opc.Ua.PubSub/Encoding/JsonNetworkMessage.cs 90.34% <100.00%> (ø)

... and 187 files with indirect coverage changes

@mregen
Copy link
Contributor Author

mregen commented Jan 29, 2023

First feedback in the dev meeting is why not extending the base IEncoder/IDecoder interface?

@mregen mregen self-assigned this Jun 3, 2023
@mregen mregen marked this pull request as ready for review June 12, 2023 07:34
@mregen mregen requested a review from salihgoncu June 14, 2023 14:47
@mregen mregen marked this pull request as draft June 15, 2023 14:15
@mregen
Copy link
Contributor Author

mregen commented Jun 15, 2023

we need to wait until the REST WG has some idea how the ABNF notation can be integrated.

@EthanChangAED EthanChangAED self-requested a review July 4, 2023 10:10
@mregen mregen marked this pull request as ready for review July 18, 2023 09:42
Copy link
Contributor

@mrsuciu mrsuciu left a comment

Choose a reason for hiding this comment

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

Code looks good, but shouldn't the year in the Copyright be updated ?

@mrsuciu mrsuciu self-requested a review July 20, 2023 07:44
@mregen mregen merged commit 0bf2e93 into master Jul 20, 2023
70 of 72 checks passed
@mregen mregen deleted the ijsonencodeable branch July 20, 2023 13:38
@mregen
Copy link
Contributor Author

mregen commented Jul 20, 2023

Code looks good, but shouldn't the year in the Copyright be updated ?

good point, I need to check what the policy is. Effectively the PR was done in 2022, just sitting very long. in the past we did bulk updates from time to time...

TimJoehnk pushed a commit to TimJoehnk/UA-.NETStandard that referenced this pull request Aug 4, 2023
- in order to abstract the implementation of a IEncoder/IDecoder  for Json with some extra methods and properties, derive JsonEncoder/Jsondecoder from a IJsonDecoder/IJsonEncoder interface
- breaking change: the use of reversible/non-reversible subencoding is handled by a new method:
`void UsingReversibleEncoding<T>(Action<string, T> action, string fieldName, T value, bool useReversibleEncoding)`
TimJoehnk added a commit to TimJoehnk/UA-.NETStandard that referenced this pull request Aug 4, 2023
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.

None yet

3 participants