uplink icon indicating copy to clipboard operation
uplink copied to clipboard

Add support for parsing JSON objects using `glom`

Open prkumar opened this issue 7 years ago • 0 comments

Is your feature request related to a problem? Please describe. glom is a library that provides a lot of neat functionality in terms of parsing nested structures, like JSON objects.

Describe the solution you'd like We can introduce a parser argument for @uplink.returns.json that supports custom parsing strategies for JSON responses:

@uplink.returns.json(key="a.b.c", parser="glom")

Further, glom provides support for converting dictionary-like objects into objects, which seems like a great fit for adding a custom ConverterFactory for glom, too.

Additional context This issue is related to feedback provided by @liiight through the Uplink Gitter lobby: https://gitter.im/python-uplink/Lobby?at=5c1a04f7b4ef82024857910d. @liiight also proposed exposing a specific decorator for glom:

@uplink.returns.glom('a.b.c')

prkumar avatar Dec 19 '18 23:12 prkumar