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

Change converting JSON more straightforward #32

Open dmikurube opened 7 years ago

dmikurube commented 7 years ago

Values assumed to be JSON are converted to Embulk JSON by 1) converting to String, and then 2) parsing to Embulk JSON (msgpack Value).

We may want to make this more straightforward.

hiroyuki-sato commented 7 years ago

Many plugins want to cast many values from type A to Type B. I hope embulk-core support those features. Ex) https://github.com/sonots/embulk-filter-typecast/blob/master/src/main/java/org/embulk/filter/typecast/JsonCaster.java

Currently many plugins copied those classes.

dmikurube commented 7 years ago

@hiroyuki-sato Thanks for your comments. Sure, we may want such conversion in the Embulk core. This issue #32 in embulk-base-restclient is actually a different topic to discuss that, though.

Let's discuss that in github.com/embulk/embulk. :)

dmikurube commented 7 years ago

For this embulk-base-restclient, we'd consider using https://github.com/msgpack/msgpack-java/tree/develop/msgpack-jackson or else like that. #51 is fixed tentatively by toString in #52.

hiroyuki-sato commented 7 years ago

@dmikurube Thanks! I thought these features are useful for another plugin. :smile:

muga commented 7 years ago

Prototyped jackson-datatype-msgpack on https://github.com/muga/jackson-datatype-msgpack. It might enable directly converting JsonNodes to/from MessagePack's Values. Next step is: Improve more and write tests. Then, Create PR for msgpack-java.