dice-group / FOX

Federated Knowledge Extraction Framework
GNU Affero General Public License v3.0
189 stars 51 forks source link

Return JSON object instead of string serialization when JSON-LD is requested #4

Closed yamalight closed 10 years ago

yamalight commented 10 years ago

So, at the moment if you ask for JSON-LD, you'll get a very strange object back that has output serialized as an URL encoded string. This adds two additional steps to make processing of such response possible (1 - decode url components, 2 - parse json). And probably adds two steps to serializations as well.

Is there any reason for this? Wouldn't it be better to just have like normal JSON as output? With nested objects and all the good stuff? If it would - please do so :)

renespeck commented 10 years ago

The 'very strange object' is a valid JSON object/string described in the demo documentation. So it is a 'normal JSON as output', always the same one.

But you are right with the encoded/decoding. This could be replaced with a more conventional method, maybe in version 3.0.0 or feel free to send a pull request.

yamalight commented 10 years ago

I wasn't saying the object was invalid, it's just the approach "yo dawg I heard you like json so I encoded json into serialized string and put it into json field in your json" is a bit, well, strange :D