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