9 writes to ModelMetadata
Microsoft.AspNetCore.Grpc.Swagger (3)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (3)
118ModelMetadata = new GrpcModelMetadata(identity), 140ModelMetadata = new GrpcModelMetadata(identity), 160ModelMetadata = new GrpcModelMetadata(identity),
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
DefaultApiDescriptionProvider.cs (1)
660ModelMetadata = bindingContext.ModelMetadata,
EndpointMetadataApiDescriptionProvider.cs (2)
146ModelMetadata = CreateModelMetadata(acceptsRequestType ?? typeof(void)), 191ModelMetadata = CreateModelMetadata(parameter, paramType),
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
2080description.ModelMetadata = modelMetadataProvider.GetMetadataForProperty(typeof(Person), nameof(Person.Name)); 2131description.ModelMetadata = modelMetadataProvider.GetMetadataForProperty(typeof(Person), nameof(Person.Name));
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
JsonPatchOperationsArrayProvider.cs (1)
47parameterDescription.ModelMetadata = _modelMetadataProvider.GetMetadataForType(typeof(Operation[]));
40 references to ModelMetadata
Microsoft.AspNetCore.Mvc.Abstractions (1)
ApiExplorer\ApiParameterDescription.cs (1)
15/// Gets or sets the <see cref="ModelMetadata"/>.
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
DefaultApiDescriptionProvider.cs (3)
270parameter.ModelMetadata is DefaultModelMetadata defaultModelMetadata && 313if (parameter.ModelMetadata != null && parameter.ModelMetadata.IsBindingRequired)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (29)
DefaultApiDescriptionProviderTest.cs (2)
1354Assert.True(parameter.ModelMetadata.IsRequired); 1355Assert.True(parameter.ModelMetadata.IsBindingRequired);
EndpointMetadataApiDescriptionProviderTest.cs (27)
423Assert.Equal(typeof(int), param.ModelMetadata.ModelType); 438Assert.Equal(typeof(string), param.ModelMetadata.ModelType); 452Assert.Equal(typeof(int), param.ModelMetadata.ModelType); 466Assert.Equal(expectedTYpe, param.ModelMetadata.ModelType); 487Assert.Equal(expectedTYpe, param.ModelMetadata.ModelType); 508Assert.Equal(typeof(int?), param.ModelMetadata.ModelType); 522Assert.Equal(typeof(string), param.ModelMetadata.ModelType); 536Assert.Equal(typeof(T), param.ModelMetadata.ModelType); 558Assert.Equal(typeof(T), param.ModelMetadata.ModelType); 574Assert.Equal(typeof(int), param.ModelMetadata.ModelType); 600Assert.Equal(expectedType, param.ModelMetadata.ModelType); 626Assert.Equal(typeof(int), fooParam.ModelMetadata.ModelType); 633Assert.Equal(typeof(int), barParam.ModelMetadata.ModelType); 640Assert.Equal(typeof(InferredJsonClass), fromBodyParam.ModelMetadata.ModelType); 656Assert.Equal(typeof(int), param.ModelMetadata.ModelType); 663Assert.Equal(typeof(int), param.ModelMetadata.ModelType); 671Assert.Equal(typeof(InferredJsonClass), param.ModelMetadata.ModelType); 716Assert.NotNull(apiDescription.ParameterDescriptions[0].ModelMetadata.ContainerType); 717Assert.Equal(typeof(AsParametersWithRequiredMembers), apiDescription.ParameterDescriptions[0].ModelMetadata.ContainerType); 747Assert.Equal(typeof(int), fooParam.ModelMetadata.ModelType); 753Assert.Equal(typeof(int?), barParam.ModelMetadata.ModelType); 792Assert.Equal(typeof(string), fooParam.ModelMetadata.ModelType); 798Assert.Equal(typeof(int), barParam.ModelMetadata.ModelType); 811Assert.Equal(typeof(string), nameParam.ModelMetadata.ModelType); 1296Assert.Equal(typeof(IFormFile), fromFileParam0.ModelMetadata.ModelType); 1302Assert.Equal(typeof(IFormFile), fromFileParam1.ModelMetadata.ModelType); 1314Assert.Equal(expectedType, param.ModelMetadata.ModelType);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
JsonPatchOperationsArrayProviderTests.cs (1)
46Assert.Equal(typeof(Operation[]), description.ModelMetadata.ModelType);
Microsoft.AspNetCore.OpenApi (6)
Extensions\JsonNodeSchemaExtensions.cs (1)
306if (parameterDescription.ModelMetadata is { PropertyName: { }, ContainerType: { }, HasValidators: true, ValidatorMetadata: { } validations })
Services\OpenApiDocumentService.cs (4)
519if (parameter.All(parameter => parameter.ModelMetadata.ContainerType is null)) 692&& parameter.ModelMetadata.ModelType != parameter.Type 693&& parameter.ModelMetadata.ModelType.IsEnum; 699? parameter.ModelMetadata.ModelType
Services\Schemas\OpenApiSchemaService.cs (1)
132&& parameterDescription.ModelMetadata.PropertyName is null