Skip to content
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

Parse "strict mode" allows leading zeroes, invalid pre-release identifiers #16

Closed
zarenner opened this issue Feb 12, 2016 · 3 comments
Closed
Labels

Comments

@zarenner
Copy link

Per http://semver.org/#spec-item-2
"A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes."

The strict parameter in Parse/TryParse should either perform this validation (which would be a breaking semantic change), or another parameter should be added to allow enforcing this. Thoughts?

I'm happy to contribute a fix.

@zarenner zarenner changed the title Parse "strict mode" allows leading zeroes Parse "strict mode" allows leading zeroes, invalid pre-release identifiers Feb 17, 2016
@WalkerCodeRanger WalkerCodeRanger added this to the v3.0 milestone Oct 12, 2019
@WalkerCodeRanger
Copy link
Owner

I'm hoping to improve this with issue #38 "Improve Parsing Options", but the actual breaking change will have to be in v3.0.

@WalkerCodeRanger
Copy link
Owner

Since it may not be obvious, the title refers to version strings like "1.0.0-alpha.01" which is invalid according to the BNF in the spec because the prerelease segment "01" is not a valid numeric segment.

@WalkerCodeRanger
Copy link
Owner

The new parsing methods in v2.1.0 fix this. The old parsing methods are obsolete and will be removed in v3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants