embulk / embulk-base-restclient

Base class library for Embulk plugins to access RESTful services
https://www.embulk.org/
Apache License 2.0
6 stars 7 forks source link

Handle empty JSON value #51

Closed dmikurube closed 7 years ago

dmikurube commented 7 years ago

Encountered a practical issue in converting JsonNode to msgpack Value, which was mentioned in #12.

In Json, special reasons to once convert into String and then parse that. Not to directly convert JsonNode to msgpack Value?

If the JsonNode value is empty in JacksonServiceValue#jsonValue, value.asText() goes an empty String, and an empty String cannot be parsed by the JSON Parser. :(

If we use toString instead of asText, it goes "{}". It might be the reason why toString was used originally?

We have two choices:

  1. Get this simply back to toString.
  2. Convert JsonNode directly to msgpack Value.

2 may be finally better, but 1 can be a short-term solution.

Can I have your thoughts? @muga

dmikurube commented 7 years ago

This is fixed by #52. Will consider more on #32.