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

feat: improve DataSchemaValue handling #86

Merged
merged 7 commits into from
Dec 31, 2023
Merged

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Dec 23, 2023

This PR reworks both the internal handling of DataSchemaValues as well as the external API for passing in InteractionInputs. A potential InteractionInput is now more strongly typed and makes it possible to differentiate between DataSchemaValues and Streams more reliably. Due to these changes, the behavior of the library should now be more in line with the Scripting API specification which makes a clear distinction here.

However, this rework has some side effects: For instance, the new, stricter handling of DataSchemaValues disallows the use of CBOR objects that use non-string-based keys. Morever, it revealed some inconsistencies in the implementation of ContentCodecs as well as the validation logic in the value() method of the InteractionOutput interface. These aspects need to be improved in follow-up PRs.

Lastly, to improve code coverage and quality of the library, several additional tests are also included in this PR. Testing is another area that will be improved upon in upcoming PRs.

@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2023

Codecov Report

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

Comparison is base (e6610fe) 56.52% compared to head (2feb002) 59.61%.

Files Patch % Lines
lib/src/core/thing_discovery.dart 0.00% 10 Missing ⚠️
lib/src/core/consumed_thing.dart 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   56.52%   59.61%   +3.09%     
==========================================
  Files          68       70       +2     
  Lines        2261     2387     +126     
==========================================
+ Hits         1278     1423     +145     
+ Misses        983      964      -19     

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

@JKRhb JKRhb force-pushed the dataschema-value-improvements branch 2 times, most recently from 1c61288 to ecc8cc4 Compare December 31, 2023 14:42
@JKRhb JKRhb force-pushed the dataschema-value-improvements branch from d285ded to 2feb002 Compare December 31, 2023 14:44
@JKRhb JKRhb marked this pull request as ready for review December 31, 2023 14:44
@JKRhb JKRhb enabled auto-merge December 31, 2023 14:44
@JKRhb JKRhb merged commit 943c75d into main Dec 31, 2023
4 checks passed
@JKRhb JKRhb deleted the dataschema-value-improvements branch December 31, 2023 14:48
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.

2 participants