Skip to content

Commit

Permalink
optimized postUrl extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
yvasyliev committed Nov 8, 2023
1 parent 99313a2 commit b9c21cf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Post deserialize(JsonParser jsonParser, DeserializationContext deserializ
var jsonPost = jsonParser.readValueAs(JsonNode.class);
var author = jsonPost.get("author").textValue();
var created = jsonPost.get("created").intValue();
var postUrl = jsonPost.has("url_overridden_by_dest") ? jsonPost.get("url_overridden_by_dest").textValue() : jsonPost.get("url").textValue(); // TODO: 11/8/2023 simplify
var postUrl = jsonPost.path("url_overridden_by_dest").asText(jsonPost.get("url").textValue());

jsonPost = extractRootPost(jsonPost);
for (var postMapper : postMappers) {
Expand Down

0 comments on commit b9c21cf

Please sign in to comment.