-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bibliography API and listing functionality #320
Open
stschiff
wants to merge
8
commits into
master
Choose a base branch
from
add_bib_listing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #320 +/- ##
==========================================
- Coverage 59.88% 59.24% -0.64%
==========================================
Files 29 29
Lines 4170 4296 +126
Branches 481 487 +6
==========================================
+ Hits 2497 2545 +48
- Misses 1192 1264 +72
- Partials 481 487 +6 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
I bumped the version to 1.5.9.0, so I expect this to be merged in after #318. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR finally adds a new Server API
/bibliography
as well as a new command-line optiontrident list --bibliography
to gather bibliography information.The feature is straight-forward in terms of usability.
In terms of implementation, I have made some additional changes to the Aeson interface specifically for the Server Communication. Specifically I looked a bit closer how Aeson encodes for
Nothing
s inMaybe
types, and found out that by default these get encoded asnull
in objects. This is slightly wasteful, as null-fields can also simply be omitted in a given object. When decoding into Haskell types again, we anyway use the operator.:?
, which takes care of interpreting missing keys in objects asNothing
s. I have therefore added a small function calledremoveNulls
inServerClient.hs
to remove null-fields from objects. Not sure how big the effect is, but it was simple enough and I'm glad I now understandMaybe
-encoding in Aeson better. The newest version of Aeson (>2.2.2.0) actually adds an encoding operator to remove null-values, which will eventually make my function redundant, but that latest version isn't even in the latest LTS, so it'll be some time.Running the new bibliography function on the Community-Archive reveals some gaps in our bibliography records, which we can easily fix with a bit of curation work.