You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both case 1 and case 2 couldn't get similar results in 5.11.
Could you update the code for this part? Or could you please check if I misunderstand the document? thanks.
The text was updated successfully, but these errors were encountered:
Could you please support the primary keys in data attributes field??? (It is related to section 4.10 and section 5.11.)
https://ref.gs1.org/standards/digital-link/uri-syntax/
‘data attributes’ MAY include AIs that may also be used as primary keys
I found this change "Suppressed restriction on only one primary key", however this is just partial support 4.10.
109bb36
for the current code base: https://github.com/gs1/GS1DigitalLinkCompressionPrototype/blob/master/src/GS1DigitalLinkToolkit.js
case 1: When the input string is "010000012300001780040001ABC" , the return value of gs1ElementStringsToGS1DigitalLink() is "https://id.gs1.org/8004/0001ABC"
However, the correct result should be "https://id.gs1.org/01/0100000123000017?8004=0001ABC" in section 5.11
var DigitalLink = new Object();
DigitalLink.Input = "010000012300001780040001ABC";
DigitalLink.Compressed = false
DigitalLink.ReadableAI = false
DigitalLink.BaseURL = null
DigitalLink.BaseURL = "https://id.gs1.org"
DigitalLink.Compressed = false
DigitalLink.ReadableAI = false
var gs1dlt = new GS1DigitalLinkToolkit();
var elementStringsNoBrackets = DigitalLink.Input;
elementStringsNoBrackets = elementStringsNoBrackets.replace(/^1/g, gs1dlt.groupSeparator); // replace all ^1 occurrences.
if (DigitalLink.Compressed) {
gs1dlt.gs1ElementStringsToCompressedGS1DigitalLink(elementStringsNoBrackets, DigitalLink.ReadableAI, DigitalLink.BaseURL);
}
else {
gs1dlt.gs1ElementStringsToGS1DigitalLink(elementStringsNoBrackets, DigitalLink.ReadableAI, DigitalLink.BaseURL);
}
case 2: when input string is "80040001ABC^10100000123000017" , the return value of gs1ElementStringsToGS1DigitalLink() is "https://id.gs1.org/8004/0001ABC"
However, the correct result should be "https://id.gs1.org/8004/00001ABC?01=0100000123000017" in section 5.11
var DigitalLink = new Object();
DigitalLink.Input = "80040001ABC^10100000123000017";
DigitalLink.Compressed = false
DigitalLink.ReadableAI = false
DigitalLink.BaseURL = null
DigitalLink.BaseURL = "https://id.gs1.org"
DigitalLink.Compressed = false
DigitalLink.ReadableAI = false
var gs1dlt = new GS1DigitalLinkToolkit();
var elementStringsNoBrackets = DigitalLink.Input;
elementStringsNoBrackets = elementStringsNoBrackets.replace(/^1/g, gs1dlt.groupSeparator); // replace all ^1 occurrences.
if (DigitalLink.Compressed) {
gs1dlt.gs1ElementStringsToCompressedGS1DigitalLink(elementStringsNoBrackets, DigitalLink.ReadableAI, DigitalLink.BaseURL);
}
else {
gs1dlt.gs1ElementStringsToGS1DigitalLink(elementStringsNoBrackets, DigitalLink.ReadableAI, DigitalLink.BaseURL);
}
Both case 1 and case 2 couldn't get similar results in 5.11.
Could you update the code for this part? Or could you please check if I misunderstand the document? thanks.
The text was updated successfully, but these errors were encountered: