-
Notifications
You must be signed in to change notification settings - Fork 1
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
List with several identical user extension elements in XML: correct conversion into JSON/JSON-LD? #20
Comments
Dear @RalphTro, {"example:userListElement": [
"1",
"2",
"3"
]
} would be my preferred JSON representation. Actually, in my opinion, this is would be the ideal JSON for such a custom extension: {"example:userList": [
"1",
"2",
"3"
]
} It's impossible to come up with a generic way of converting custom extension into into nice looking XML and JSON, without providing an SPI (Service Provider Interface) to the converter, that is responsible for taking care of the tiny details when converting user defined extension. And that's reason why you ended up geting something between a) and b) 😄 |
Many thanks for your quick feedback, Sven! Yes, I think the implication/summary of this matter is: whenever an EPCIS implementation requires to support both syntaxes and has user extensions, the respective solution provider should generate the messages in both XML and JSON/JSON-LD and may provide, if applicable, an SPI to ensure a desired conversion behaviour. Closing this ticket as this cannot be addressed through the tool. |
Dear @RalphTro But that also means if users are actually applying some beautification logic, like I mentioned in my previous comment, this may become a huge issue when creating event hashes. |
Dear @sboeckelmann , Before we continue though, I think it would be helpful for the SMG to understand the use case. In which situations would this be important to have from your POV? As soon as we identified a compelling Use Case: I am not sure whether all use/edge cases can be tackled technically (see your earlier comment), so how do you like the idea of at least defining a small set of conventions/rules for the most common user extension structures so that independent implementations translate a given JSON-/JSON-LD structure into XML in a consistent manner? Or do you have sth. different in mind? |
Dear @sboeckelmann and colleagues,
I just came across the following observation while using your (great) tool which I want to discuss with you:
Let us assume we have the following user extension element in XML:
Right now, the tool converts it into the following JSON structure:
Are you sure that this is really the correct/desired output? I am especially struggling with how "entry" becomes a list name.
My expectation was that the tool would convert it into sth. like this:
(a)
or
(b)
What is your opinion on this matter?
FYC, I enclosed the input XML file which I was using.
XMLWithRepeatableUserExtensionElements.xml.zip
Many thanks in advance for sharing your thoughts.
Kind regards,
Ralph
The text was updated successfully, but these errors were encountered: