-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot customize the array separator #272
Comments
There is no functionality currently for "embedded" arrays like this: only array item separator (defaults to I will leave this open in case someone would like to add support for optional start/end markers (brackets here); support would be needed for both serialization and deserialization. |
OK, thanks! |
I recently stumbled across this issue as I have to deal with arrays of nested objects within a CSV string. I am not quite sure if I can find some time to work on this issue. But if so, than adapting The question arises, if only something like |
I would limit functionality to arrays of scalar, and not having to invent new format/notation for full set of types. In theory, supporting full set could be done by allowing nesting of JSON within cells, but that'd require whole new level of functionality (although could be useful for embedding within other formats too). And without looking deeper into code, I think you are right that |
For my specific application, nesting types are exactly what is required. I need to transmit data via an ancient radio data link. We are talking about bytes, not kilobytes, which is why the payload has to be kept as minimal as possible. Essentially, the data looks like this:
where record Payload(
int id,
String label,
List<Nested> nested,
String description,
int number
) { }
record Nested(
String text,
int code,
boolean state
) { } Since this is currently not feasible with Jackson, I have built a module in which I register customized So for me, this is not urgent (anymore). Unfortunately, I won't be able to work on it in the near future and therefore won't be able to provide a PR in the short term. Should I unexpectedly find some time for this in the future, I will report here. |
@mrpiggi Ok, I understand. But maybe your work can help future developments. And just to make it clear: I think that additional module(s), to support "embedded" structured data, would make lots of sense. It's hard to come with "one and only" notation to make it default for CSV, but ability to plug in alternate extensions would be awesome. Doing that may need improved configurability/pluggability, of course. |
I would like to contribute to an expansion, otherwise I wouldn't have given my input here. At the moment, however, I unfortunately have absolutely no time to do anything on the side. The list of things I want to do after work is getting longer rather than shorter. And at the moment my working day stretches deep into the night... |
@mrpiggi Understood. Sorry, did not mean to sound like I was expecting you to do more here; I know how precious time is. Take care! |
That's not how I understood it either ;) Many thanks. |
How to define the array separator as square brackets'[]'?E.g:1,[1,2,3],['name01','name02','name03'],'pen',1
The output of the following code is:1,'1,2,3','name01,name02,name03',pen,1
The expected output is:1,[1,2,3],['name01','name02','name03'],'pen',1
The text was updated successfully, but these errors were encountered: