Closed jms90h5 closed 10 years ago
+1 to a JSON toollkit
I have a simple operator that converts tuples to JSON, using the Java Operator API JSON mapping.
I think it'd be nice for that to go up in conjunction with the JSON to tuple operator from @rohitsw here: https://www.ibm.com/developerworks/community/files/app?lang=en#/file/d8bd5118-4587-4b3e-b43e-4b1717f8691f
+1 for a JSON toolkit.
I think we may want to provide a common toolkit which includes a number of parsers and formatters for different types in the future. I think it makes sense to start with separate type specific toolkits like JSON and decide if we want to package or converge similar toolkits in the future rather than start off with a common toolkit and concerns over getting the structure right before we know how it might evolve.
I have modified my JSON toolkit to work with the latest streams version and use the operator json type. i plan to name them: com.ibm.streamsx.parsers.json Should we have a new repository "streamsx.parsers" or simply add it to the toolkit repository?
I had thought a parsers toolkit with many formats would be desirable but I'm leaning more towards a JSON toolkit now. We could always combine toolkits to have a parsers one in the future.
@rohitsw The toolkits repository is not for SPL code, it's just a project to manage the community.
i've submitted a new issue to create a streamsx.parsers repository where I can put the json toolkit
The current plan is a repository per toolkit, so there would be a streamsx.json repository.
I created streamsx.json.
Creating the correct permissions is still to be done, but it can be forked and pull requests created.
Note I did not include parsers in the name, just defined it as a toolkit for using JSON in SPL, There could be other JSON related functionality that are not parser related.
Since the JSONEncoding interface has been added to the SPL Java Operator API it would seem to be a good idea to update the JSONHelper toolkit to use it. Not only would it simplify the implementation, it would ensure that exactly the same underlying encoding logic was executed regardless of access mechanism.
The only reason I can think of to keep the "manual" implementation is to allow for a some kind of different encoding than what the Java Operator API does. In that case it would be useful to have a second helper toolkit that uses the native API to allow SPL programmers to convert tuples to and from JSON using that encoding logic without everyone having to create their own custom java operator.