-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support streams of multiple documents #16
Comments
@nichtich You seem to be well versed in XML. What would you expect the output of {
"type": "Polygon",
"coordinates": [
[
[
-122.422003528252475,
37.808480096967251,
0.0
],
[
-122.422003528252475,
37.808480096967251,
0.0
]
]
]
} to be in XML? |
I created another issue for this and related examples. I first thought about not supporting nested arrays at all but the current solution with |
Cool thanks. The issue with being able to specify that is it would be global, which is probably fine? I.e. in a 3D array like that, there wouldn't be a way to target a specific level of the nested array. The way around this is using a transformation to give keys to those values, as it'll use the key name if there is one. |
Yes. Alternatives I can think of is to ignore nested array elements, flatten nested arrays or to raise an error, but your approach looks more useful. The only argument against is more difficult XML reading to ensure round-tripping conversion (XML->JSON->XML->JSON should be equal to XML->JSON). I worked a lot with XML and created a similar JSON/XML mapping tool (see Catmandu::XML and other Catmandu modules) but there is no silver bullet. |
Yea I can't imagine being able to convert formats and have everything be 1:1 conversions. Are always going to be some edge cases IMO. It helps that you can use |
The current implementation of Crystal's Possibly can revisit it in the future. |
Expected:
Sure this makes more sense with #14. YAML on the other hand supports multiple documents concatenated.
sorry for coming up with all of these edge cases, I'm actually looking for them 🙈
The text was updated successfully, but these errors were encountered: