Instagram / ig-json-parser

Fast JSON parser for java projects
https://instagram-engineering.com/fast-auto-generated-streaming-json-parsing-for-android-ab8e7be21033
MIT License
1.32k stars 125 forks source link

Add JsonHelper interface #29

Closed kangzhang closed 8 years ago

kangzhang commented 8 years ago

Summary:

We run into this issue recently that we can't make a strong typed API to enforce type checking on the generated helper class.

In the following API:

new AutoJsonParser(Foo__JsonHelper.class)

We can't avoid people passing in BarJsonHelper.class instead of FooJsonHelper.class

Test Plan:

1) unittest

kangzhang commented 8 years ago

Totally, it would be nice if we can have a fully strong typed interface!

I'm less worried about changing from static method to member method. How to make it work cleanly with optional serializer/deserializer function is another question. (create interface for each function?)

ttung commented 8 years ago

i guess an interface for each function that can be enabled?

or you can wait on the need for creating those interfaces.

tkieft commented 8 years ago

Nice!