6 writes to IsRequired
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
DefaultApiDescriptionProvider.cs (4)
305
parameter.
IsRequired
= !mvcOptions.AllowEmptyInputInBodyModelBinding;
309
parameter.
IsRequired
= !(parameter.BindingInfo.EmptyBodyBehavior == EmptyBodyBehavior.Allow);
315
parameter.
IsRequired
= true;
320
parameter.
IsRequired
= true;
EndpointMetadataApiDescriptionProvider.cs (2)
149
IsRequired
= !isOptional,
195
IsRequired
= !isOptional,
38 references to IsRequired
ApiExplorerWebSite (1)
ApiExplorerDataFilter.cs (1)
70
IsRequired = parameter.
IsRequired
,
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (36)
DefaultApiDescriptionProviderTest.cs (7)
2029
Assert.True(description.
IsRequired
);
2043
Assert.False(description.
IsRequired
);
2064
Assert.False(description.
IsRequired
);
2086
Assert.True(description.
IsRequired
);
2104
Assert.True(description.
IsRequired
);
2118
Assert.False(description.
IsRequired
);
2137
Assert.False(description.
IsRequired
);
EndpointMetadataApiDescriptionProviderTest.cs (29)
114
Assert.False(apiParameterDescription.
IsRequired
);
129
Assert.True(apiParameterDescription.
IsRequired
);
628
Assert.True(fooParam.
IsRequired
);
635
Assert.True(barParam.
IsRequired
);
642
Assert.True(fromBodyParam.
IsRequired
);
658
Assert.True(param.
IsRequired
);
665
Assert.True(param.
IsRequired
);
673
Assert.False(param.
IsRequired
);
704
param => Assert.True(param.
IsRequired
),
705
param => Assert.False(param.
IsRequired
),
706
param => Assert.True(param.
IsRequired
),
707
param => Assert.False(param.
IsRequired
));
734
param => Assert.True(param.
IsRequired
),
735
param => Assert.False(param.
IsRequired
));
749
Assert.True(fooParam.
IsRequired
);
755
Assert.False(barParam.
IsRequired
);
794
Assert.False(fooParam.
IsRequired
);
800
Assert.True(barParam.
IsRequired
);
813
Assert.False(nameParam.
IsRequired
);
1051
Assert.False(bodyParameterDescription.
IsRequired
);
1110
Assert.True(bodyParameterDescription.
IsRequired
);
1142
Assert.False(bodyParameterDescription.
IsRequired
);
1174
Assert.False(bodyParameterDescription.
IsRequired
);
1202
Assert.True(bodyParameterDescription.
IsRequired
);
1231
Assert.False(bodyParameterDescription.
IsRequired
);
1260
Assert.True(bodyParameterDescription.
IsRequired
);
1298
Assert.True(fromFileParam0.
IsRequired
);
1304
Assert.False(fromFileParam1.
IsRequired
);
1348
Assert.True(bodyParameterDescription.
IsRequired
);
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
450
return parameter.Source == BindingSource.Path || parameter.
IsRequired
|| hasRequiredAttribute;