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

Handle null body in CreateRequest. #97

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

ejball
Copy link
Contributor

@ejball ejball commented Oct 3, 2024

No description provided.

@ejball ejball merged commit f8f41b5 into FacilityApi:master Oct 3, 2024
3 checks passed
@ejball ejball deleted the null-body-fix branch October 3, 2024 17:59
@@ -910,7 +910,7 @@ private CodeGenFile GenerateHttpMapping(HttpServiceInfo httpServiceInfo, Context
foreach (var field in httpMethodInfo.RequestNormalFields)
{
var fieldName = context.GetFieldPropertyName(field.ServiceField);
code.WriteLine($"{fieldName} = (({requestTypeName}) body{NullableReferenceBang}).{fieldName},");
code.WriteLine($"{fieldName} = (({requestTypeName}?) body)?.{fieldName},");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{requestTypeName}? is an error when nullable types are not enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! #102

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.

2 participants