semver4j icon indicating copy to clipboard operation
semver4j copied to clipboard

Invalid Suffix

Open amiel92 opened this issue 4 years ago • 2 comments

Hi,

if i get the semantic versioning specification right (https://semver.org/#spec-item-9), the following versions sould not be valid:

Semver sv = new Semver("1.0.0-"); //Identifiers MUST NOT be empty sv = new Semver("1.0.0-alpha..1"); //Identifiers MUST NOT be empty sv = new Semver("1.0.0-001"); //Numeric identifiers MUST NOT include leading zeroes sv = new Semver("1.0.0-äöü"); //Identifiers MUST comprise only ASCII alphanumerics and hyphen

amiel92 avatar Oct 31 '19 09:10 amiel92

We also run into this issue. We had users enter 1.2.3. (so with a trailing dot) as a version in our application, causing issues downstream. I believe the TS is right and this is not a valid semver according to the specification.

jankeesvanandel avatar Feb 21 '22 15:02 jankeesvanandel

@amiel92 if you are still interesting, I've made copy of this lib and fix bug reported by you. Look for version 2.0.1

piotrooo avatar Jul 22 '22 22:07 piotrooo