Skip to content

Ensure that PreReleaseNumber is always a number #1293

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

Closed
wants to merge 3 commits into from
Closed

Ensure that PreReleaseNumber is always a number #1293

wants to merge 3 commits into from

Conversation

pitermarx
Copy link

Because of the JsonOutputFormatter, the json output can either be "PreReleaseNumber": number or "PreReleaseNumber": null
this can have impact on desserialization as found on Cake

Because of the [JsonOutputFormatter](https://github.com/GitTools/GitVersion/blob/c5ae891d56a8d6d52ac4f756a6727a41071332b1/src/GitVersionCore/OutputFormatters/JsonOutputFormatter.cs), the json output can either be "PreReleaseNumber": number or "PreReleaseNumber": null
this can have impact on desserialization as found on [Cake](cake-build/cake#1798)
@matkoch
Copy link
Contributor

matkoch commented Sep 15, 2017

@pitermarx I don't think this should be done. There is a meaningful difference between a PreReleaseNumber being null or 0.

@asbjornu
Copy link
Member

@pitermarx: I agree with @matkoch. I interpret a PreReleaseNumber set to 0 to mean that the release is not stable and at version 0. A PreReleaseNumber set to null indicates that the release is stable. To represent this property in C#, I would use Nullable<int>, so both states can be captured.

@pitermarx
Copy link
Author

pitermarx commented Sep 15, 2017 via email

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

Successfully merging this pull request may close these issues.

3 participants