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

Make code generation respectful to null values #1210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asvishnyakov
Copy link

@asvishnyakov asvishnyakov commented Jun 25, 2020

#1197 fix

Currently if value is null or undefined (checked as value ? doSomething(value) : <any>undefined), it will set undefined to object if value is null, that's incorrect. If we pass null as value, it should still be null value. That's two different values, including API: for example, ASP.NET core will produce 415 error if you will send empty body (undefined) instead of null value.

The easiest way to fix it without making multiple checks for null and undefined is to just pass data value back if it's null or undefined: value ? doSomething(value) : value

@asvishnyakov
Copy link
Author

@RicoSuter please review

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.

1 participant