evrythng / digital-link.js

GS1 Digital Link SDK for working with Digital Links as objects, including validation.
Apache License 2.0
2 stars 1 forks source link

customURIstem and optional path segments #17

Closed mgh128 closed 3 years ago

mgh128 commented 3 years ago

Thanks very much for testing the ABNF and identifying errors.

I agree with everything you've suggested except for

customURIstem = scheme "://" hostname ; *( "/" segment )

According to https://tools.ietf.org/html/rfc5234#page-9 semicolon starts a comment to the end of the line, so effectively you're commenting out *( "/" segment ) and I suspect that your ABNF would therefore currently not consider the following to be valid:

https://example.com/some/other/path/info/01/01234567890128/21/12345

I think that the following might work better:

optionalPathSegment = "/" segment customURIstem = scheme "://" hostname *optionalPathSegment

domguinard commented 3 years ago

Of course, sorry for not spotting this turned it into a comment. We'll try again with the option you've listed up there.

clementh59 commented 3 years ago

Indeed, we don't handle this case, thanks for noticing this.

I tried your solution but it doesn't work for me because the elements that should be recognized as the gs1-path are recognized as optionalPathSegment. (As you can see from the picture) Screenshot 2020-10-20 at 17 22 11. Do you know how to fix it?

Thanks

mgh128 commented 3 years ago

Hi Clément, Dom,

Thanks for checking and for the feedback. Not sure how we'd do non-greedy matching or negated patterns in ABNF. I'll see if I can find a better solution.

Best wishes

Mark

On Tue, 20 Oct 2020, 16:36 Clément Hecquet, notifications@github.com wrote:

Indeed, we don't handle this case, thanks for noticing this.

I tried your solution but it doesn't work for me because the elements that should be recognized as the gs1-path are recognized as optionalPathSegment. (As you can see from the picture) [image: Screenshot 2020-10-20 at 17 22 11] https://user-images.githubusercontent.com/37502419/96609065-66c14c00-12fa-11eb-9067-c2cb3eb00362.png. Do you know how to fix it?

Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evrythng/digital-link.js/issues/17#issuecomment-712941543, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRL3BR2KPCFMTAYMSZOTSLWVALANCNFSM4SPFOUOQ .

clementh59 commented 3 years ago

Hi Mark, the bug has been solved with the latest version of digital-link.js (1.2.1)