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 deserialization and production logic #172

Merged
merged 1 commit into from
Jun 2, 2024
Merged

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Jun 1, 2024

This PR reworks those parts of the library that are responsible for deserializing Thing Descriptions (creating ThingDescription class objects in the process) and for producing ExposedThing instances.

The validation of TDs is now “baked in” more directly into the deserialization process, making it possible to get rid of the JSON Schema based validation that was used before, making the instantiation of a ThingDescription object a bit more lightweight.

There are a few edge cases that aren't fully covered yet at the moment (especially when it comes to top-level forms and the permitted operations there), so these aspects will be re-revisited in follow-up PRs.

@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2024

Codecov Report

Attention: Patch coverage is 99.12281% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 58.50%. Comparing base (39ccee8) to head (91669cb).

Files Patch % Lines
...b/src/core/definitions/extensions/json_parser.dart 98.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #172      +/-   ##
==========================================
- Coverage   66.04%   58.50%   -7.54%     
==========================================
  Files          78       77       -1     
  Lines        2453     2010     -443     
==========================================
- Hits         1620     1176     -444     
- Misses        833      834       +1     

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

@JKRhb JKRhb force-pushed the validation-2 branch 3 times, most recently from 9414dc5 to 19a3a1d Compare June 2, 2024 18:03
@JKRhb JKRhb changed the title feat!: improve deserialization logic feat!: improve deserialization and production logic Jun 2, 2024
@JKRhb JKRhb marked this pull request as ready for review June 2, 2024 18:25
@JKRhb JKRhb merged commit a5e7775 into main Jun 2, 2024
5 checks passed
@JKRhb JKRhb deleted the validation-2 branch June 2, 2024 18:25
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