Show fetch exception at citation relation#13549
Conversation
jablib/build.gradle.kts
Outdated
|
|
||
| implementation("com.fasterxml:aalto-xml") | ||
|
|
||
| implementation("org.hisp.dhis:json-tree") |
There was a problem hiding this comment.
For optionals use kongs unirest json
There was a problem hiding this comment.
Why another json library?
Because I know the author personally. And it is fast
There was a problem hiding this comment.
For optionals use kongs unirest json
Show me. 😅
There was a problem hiding this comment.
Because I know the author personally. And it is fast
Argument by authority is not a valid reason
see: eg.g
JSONObject result = item.getJSONObject("resultList").getJSONArray("result").getJSONObject(0);
|
|
||
| if (referencesResponse.getData() == null) { | ||
| JsonNode json = JsonNode.of(response); | ||
| JsonNode disclaimerJson = json.getOrNull("citingPaperInfo.openAccessPdf.disclaimer"); |
There was a problem hiding this comment.
Use kong's unirest json that allows you to use optionals
JSONObject response = JsonReader.toJsonObject(inputStream);
JSONObject journal = journalInfo.getJSONObject("journal");
Optional.ofNullable(journal.optString("title")).ifPresent(title -> entry.setField(StandardField.JOURNAL, title));
```
There was a problem hiding this comment.
Chaining will be very ugly here?! Sure that we want to have 4 Optional.ofNullable calls? Or some chaining of null checks?
Siedlerchr
left a comment
There was a problem hiding this comment.
no new json library
use kongs unirest json for this
| ReferencesResponse referencesResponse = GSON.fromJson(response, ReferencesResponse.class); | ||
|
|
||
| if (referencesResponse.getData() == null) { | ||
| // Get error message from citingPaperInfo.openAccessPdf.disclaimer |
There was a problem hiding this comment.
Comment simply describes what the following code does without adding any new information or reasoning, violating the principle of meaningful comments.
Siedlerchr
left a comment
There was a problem hiding this comment.
good boy! using the best json
|
@trag-bot didn't find any issues in the code! ✅✨ |
* 'main' of github.com:JabRef/jabref: (26 commits) Change Open AI to Open AI (or API Compatible) (#13608) Remove all assignment tracking labels Updated architecture and components link in CONTRIBUTING.md (#13606) #13301 Fix/unicode reference marks (#13590) Show fetch exception at citation relation (#13549) More jbang caching Sequential run for moving issues Update CSL Styles (#13601) Fix gradle issues (#13603) Add System.exit (#13510) New Crowdin updates (#13600) Automatic lookup DOI at citation information. (#13596) Update heylogs from 0.10.0 to 0.11.1 (#13594) add fallback and reenable defaultcomeslast (#13593) Fix debian vagrant image (#13589) Fix: Replace string "Tests" with "Source Code Tests" in PR Comment (#13587) Fix version for SNAPSHOT (#13581) Update JDK and JavaFX (#13580) Add icon (#13579) Fixes link I broke in PR 13568 (#13577) ...
Background
The API does not return the citing information, but their web page does
https://www.semanticscholar.org/paper/Decentralized-Application-Placement-in-Fog-Mann/6870975f7f4db00ad1e2fa041545b67c6e8ef73c
Steps to test
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)