Skip to content

adding sanitized serialize - #212

Merged
keighrim merged 3 commits into
developfrom
205-safe-serialize
May 2, 2023
Merged

adding sanitized serialize#212
keighrim merged 3 commits into
developfrom
205-safe-serialize

Conversation

@keighrim

Copy link
Copy Markdown
Member

fixes#205, reopening of #211.

* validating output using built-in MMIF jsonschema
* remove non-existing annotation types from ``contains`` metadata
@codecov

codecovBot commented May 2, 2023

Copy link
Copy Markdown

Codecov Report

Merging #212 (ba80118) into develop (72f5356) will increase coverage by 0.11%.
The diff coverage is 100.00%.

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

@@ Coverage Diff @@## develop #212 +/- ##
===========================================
+ Coverage 94.29% 94.40% +0.11% 
===========================================
Files 6 6 Lines 771 787 +16 ===========================================
+ Hits 727 743 +16 
Misses 44 44 
FlagCoverage Δ
unittests94.40% <100.00%> (+0.11%)⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted FilesCoverage Δ
mmif/serialize/mmif.py97.53% <100.00%> (+0.18%)⬆️
mmif/serialize/view.py96.00% <100.00%> (+0.05%)⬆️

keighrim added 2 commits May 1, 2023 21:59
* this was a problem mainly because we do not allow an empty `annotations` list while allowing an empty `metadata.contains`.
* Mmif._serialize() method ignores any "empty" attributes during serialization, resulting in view.metadata that has neither `contains`, `error`, nor `warnings` when "safe_serializing" a view with an empty `annotations` list.
* this implementation inserts an empty dict back to view.metadata as a `contains`
@keighrimkeighrim changed the title added safe_serializeadding sanitized serializeMay 2, 2023
@keighrim
keighrim merged commit 03ed50e into developMay 2, 2023
@keighrim
keighrim deleted the 205-safe-serialize branch May 2, 2023 02:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

view.metadata.contains have items (at_types) that are not actually in annotations list

1 participant

@keighrim