-
Notifications
You must be signed in to change notification settings - Fork 7
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
Replace webpub manifest parser with pydantic (PP-1367) #2163
Conversation
6f7438a
to
2ae2600
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2163 +/- ##
==========================================
+ Coverage 90.87% 91.00% +0.12%
==========================================
Files 359 359
Lines 41263 41136 -127
Branches 8883 8842 -41
==========================================
- Hits 37498 37436 -62
+ Misses 2476 2424 -52
+ Partials 1289 1276 -13 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
4a9279d
to
50fc11c
Compare
399768d
to
1ca1dce
Compare
da3e71a
to
8101188
Compare
8101188
to
bed6d49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ready to roll! 🍣
|
||
contributor_metadata = ContributorData( | ||
sort_name=contributor.sort_as, | ||
display_name=contributor.name, | ||
display_name=str(contributor.name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. Maybe just food for future thought here, but this makes me realize that, at least for some properties (like contributors), it might not make sense for name
to be a LanguageMap
. But maybe it does (e.g., in the case of corporate authors, which might need a translation).
I note also that the schema calls for a string or a language map.
Description
Replace our custom web manifest parser with Pydantic models.
I replace the validation we were doing via a patched json schema with the pydantic parser, since it gives better errors and more closely matches what we are expecting in Palace.
Edit: I broke this one into two PRs to make it a little easier to review. This PR actually implements the new models in our existing code, #2168 adds the models.
Motivation and Context
JIRA: PP-1367
Note: After this one goes in we should cut a new release of https://github.com/ThePalaceProject/webpub-manifest-parser and then mark it as archived, since we won't be using it anymore.
How Has This Been Tested?
Checklist