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

Copy pasta in mailboxes methods Update / UpdateAsync #60

Open
dvakor opened this issue Nov 16, 2018 · 2 comments
Open

Copy pasta in mailboxes methods Update / UpdateAsync #60

dvakor opened this issue Nov 16, 2018 · 2 comments

Comments

@dvakor
Copy link

dvakor commented Nov 16, 2018

Just look at source code and found some copy pasta

https://github.com/skrusty/AsterNET.ARI/blob/master/AsterNET.ARI/ARI_1_0/Actions/MailboxesActions.cs#L77

Methods Update \ UpdateAsync in Mailboxes, have requered params oldMessages, newMessages
also this params are type of "int" and that cannot be null, but method have conditions like

if (oldMessages != null)

@skrusty
Copy link
Owner

skrusty commented Nov 16, 2018

Hi, this isn't a copy paste issue, as the code is generated from the swagger definition. The issue here is the generator isn't creating a type of int?. Feel free to submit a PR if you're happy to fix the issue in the code generator.

@shawty
Copy link

shawty commented Sep 18, 2019

Yea, I've had that before with Swagger in other projects too.

It's not actually an error, it's just that Swagger isn't perfect and it cannot always 100% of the time get the data types exactly right, especially will nullable types which is what your on about here.

int? means that you have an integer value, which is allowed to be set to "null", but int by default is a value type and normally cannot be set to "null", even the .net compiler get's it wrong occasionally, which is why the C#8 compiler and .NET core 3 are introducing some new compiler directives to try and mitigate scenarios like this.

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

No branches or pull requests

3 participants