1 type derived from JsonPropertyInfo
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (1)
14
internal sealed class JsonPropertyInfo<T> :
JsonPropertyInfo
196 references to JsonPropertyInfo
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Internal\Json\MessageTypeInfoResolver.cs (4)
45
var
propertyInfo = CreatePropertyInfo(typeInfo, field.JsonName, field, isSerializable: true);
57
var
propertyInfo = CreatePropertyInfo(typeInfo, mapping.Key, mapping.Value, isSerializable: false);
91
private
JsonPropertyInfo
CreatePropertyInfo(JsonTypeInfo typeInfo, string name, FieldDescriptor field, bool isSerializable)
93
var
propertyInfo = typeInfo.CreateJsonPropertyInfo(
Microsoft.AspNetCore.JsonPatch.SystemTextJson (9)
Internal\PocoAdapter.cs (8)
22
if (!TryGetJsonProperty(target, serializerOptions, segment, out
var
jsonProperty))
53
if (!TryGetJsonProperty(target, serializerOptions, segment, out
var
jsonProperty))
78
if (!TryGetJsonProperty(target, serializerOptions, segment, out
var
jsonProperty))
112
if (!TryGetJsonProperty(target, serializerOptions, segment, out
var
jsonProperty))
143
if (!TryGetJsonProperty(target, serializerOptions, segment, out
var
jsonProperty))
186
if (TryGetJsonProperty(target, serializerOptions, segment, out
var
jsonProperty))
202
out
JsonPropertyInfo
jsonProperty)
207
var
pocoProperty = typeInfo
JsonPatchDocumentOfT.cs (1)
720
var
matchingProp = jsonTypeInfo
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (1)
TestObjectModels\HeterogenousCollection.cs (1)
47
foreach (
var
property in jsonTypeInfo.Properties)
Microsoft.AspNetCore.OpenApi (8)
Extensions\JsonNodeSchemaExtensions.cs (2)
454
/// <param name="propertyInfo">The <see cref="
JsonPropertyInfo
" /> associated with the schema.</param>
455
internal static void ApplyNullabilityContextInfo(this JsonNode schema,
JsonPropertyInfo
propertyInfo)
Services\Schemas\OpenApiSchemaService.cs (3)
45
foreach (
var
propertyInfo in jsonTypeInfo.Properties)
297
JsonPropertyInfo
? jsonPropertyInfo,
331
foreach (
var
propertyInfo in jsonTypeInfo.Properties)
Transformers\OpenApiSchemaTransformerContext.cs (3)
16
private
JsonPropertyInfo
? _jsonPropertyInfo;
38
public required
JsonPropertyInfo
? JsonPropertyInfo { get => _jsonPropertyInfo; init => _jsonPropertyInfo = value; }
52
internal void UpdateJsonTypeInfo(JsonTypeInfo jsonTypeInfo,
JsonPropertyInfo
? jsonPropertyInfo)
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (1)
509
foreach (
var
propertyInfo in jsonTypeInfo.Properties)
Microsoft.Extensions.AI.Abstractions (15)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (6)
92
JsonPropertyInfo
? propertyInfo = null,
261
Func<
JsonPropertyInfo
, ParameterInfo?>? parameterInfoMapper =
265
foreach (
JsonPropertyInfo
property in typeInfo.Properties)
486
private readonly Dictionary<(JsonTypeInfo,
JsonPropertyInfo
?), string[]> _generated = new();
520
(JsonTypeInfo,
JsonPropertyInfo
?) key = (context.TypeInfo, context.PropertyInfo);
544
JsonPropertyInfo
? propertyInfo,
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (4)
50
public static string? GetMemberName(
JsonPropertyInfo
propertyInfo)
55
PropertyInfo? memberName = typeof(
JsonPropertyInfo
).GetProperty("MemberName", AllInstance);
119
JsonPropertyInfo
? propertyInfo)
142
public static Func<
JsonPropertyInfo
, ParameterInfo?>? ResolveJsonConstructorParameterMapper(
src\Shared\JsonSchemaExporter\JsonSchemaExporterContext.cs (3)
27
JsonPropertyInfo
? propertyInfo,
62
/// Gets the <see cref="
JsonPropertyInfo
"/> if the schema is being generated for a property.
64
public
JsonPropertyInfo
? PropertyInfo { get; }
Utilities\AIJsonSchemaCreateContext.cs (2)
46
/// Gets the <see cref="
JsonPropertyInfo
"/> if the schema is being generated for a property.
48
public
JsonPropertyInfo
? PropertyInfo => _exporterContext.PropertyInfo;
Shared (13)
JsonSchemaExporter\JsonSchemaExporter.cs (6)
92
JsonPropertyInfo
? propertyInfo = null,
261
Func<
JsonPropertyInfo
, ParameterInfo?>? parameterInfoMapper =
265
foreach (
JsonPropertyInfo
property in typeInfo.Properties)
486
private readonly Dictionary<(JsonTypeInfo,
JsonPropertyInfo
?), string[]> _generated = new();
520
(JsonTypeInfo,
JsonPropertyInfo
?) key = (context.TypeInfo, context.PropertyInfo);
544
JsonPropertyInfo
? propertyInfo,
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (4)
50
public static string? GetMemberName(
JsonPropertyInfo
propertyInfo)
55
PropertyInfo? memberName = typeof(
JsonPropertyInfo
).GetProperty("MemberName", AllInstance);
119
JsonPropertyInfo
? propertyInfo)
142
public static Func<
JsonPropertyInfo
, ParameterInfo?>? ResolveJsonConstructorParameterMapper(
JsonSchemaExporter\JsonSchemaExporterContext.cs (3)
27
JsonPropertyInfo
? propertyInfo,
62
/// Gets the <see cref="
JsonPropertyInfo
"/> if the schema is being generated for a property.
64
public
JsonPropertyInfo
? PropertyInfo { get; }
System.Text.Json (145)
System\Text\Json\Schema\JsonSchemaExporter.cs (5)
59
JsonPropertyInfo
? propertyInfo = null,
218
foreach (
JsonPropertyInfo
property in typeInfo.Properties)
401
private readonly Dictionary<(JsonTypeInfo,
JsonPropertyInfo
?), string[]> _generated = new();
428
(JsonTypeInfo TypeInfo,
JsonPropertyInfo
? PropertyInfo) key = (context.TypeInfo, context.PropertyInfo);
448
public JsonSchemaExporterContext CreateContext(JsonTypeInfo typeInfo,
JsonPropertyInfo
? propertyInfo, JsonTypeInfo? baseTypeInfo)
System\Text\Json\Schema\JsonSchemaExporterContext.cs (3)
17
JsonPropertyInfo
? propertyInfo,
33
/// The <see cref="
JsonPropertyInfo
"/> if the schema is being generated for a property.
35
public
JsonPropertyInfo
? PropertyInfo { get; }
System\Text\Json\Serialization\ArgumentState.cs (2)
7
using FoundProperties = System.ValueTuple<System.Text.Json.Serialization.Metadata.
JsonPropertyInfo
, System.Text.Json.JsonReaderState, long, byte[]?, string?>;
8
using FoundPropertiesAsync = System.ValueTuple<System.Text.Json.Serialization.Metadata.
JsonPropertyInfo
, object?, string?>;
System\Text\Json\Serialization\Attributes\JsonObjectCreationHandlingAttribute.cs (1)
14
/// When default resolvers are used this will be mapped to <see cref="
JsonPropertyInfo
.ObjectCreationHandling"/>.
System\Text\Json\Serialization\Attributes\JsonRequiredAttribute.cs (1)
14
/// this attribute will be mapped to <see cref="
JsonPropertyInfo
.IsRequired"/>.
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (9)
161
JsonPropertyInfo
jsonPropertyInfo;
296
JsonPropertyInfo
jsonPropertyInfo = JsonSerializer.LookupProperty(
338
foreach (
JsonPropertyInfo
jsonPropertyInfo in jsonTypeInfo.PropertyCache)
355
JsonPropertyInfo
? extensionDataProperty = jsonTypeInfo.ExtensionDataProperty;
386
ReadOnlySpan<
JsonPropertyInfo
> propertyCache = jsonTypeInfo.PropertyCache;
389
JsonPropertyInfo
jsonPropertyInfo = propertyCache[state.Current.EnumeratorIndex];
418
JsonPropertyInfo
? extensionDataProperty = jsonTypeInfo.ExtensionDataProperty;
462
JsonPropertyInfo
jsonPropertyInfo,
496
protected static bool ReadAheadPropertyValue(scoped ref ReadStack state, ref Utf8JsonReader reader,
JsonPropertyInfo
jsonPropertyInfo)
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (9)
11
using FoundProperty = System.ValueTuple<System.Text.Json.Serialization.Metadata.
JsonPropertyInfo
, System.Text.Json.JsonReaderState, long, byte[]?, string?>;
12
using FoundPropertyAsync = System.ValueTuple<System.Text.Json.Serialization.Metadata.
JsonPropertyInfo
, object?, string?>;
79
JsonPropertyInfo
jsonPropertyInfo = properties[i].Item1;
221
JsonPropertyInfo
jsonPropertyInfo = argumentState.FoundPropertiesAsync![i].Item1;
331
out
JsonPropertyInfo
jsonPropertyInfo,
414
JsonPropertyInfo
? jsonPropertyInfo;
514
JsonPropertyInfo
jsonPropertyInfo)
617
out
JsonPropertyInfo
jsonPropertyInfo,
632
if (!useExtensionProperty && jsonPropertyInfo !=
JsonPropertyInfo
.s_missingProperty)
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
227
JsonPropertyInfo
? propertyInfo = state.Current.JsonPropertyInfo;
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (5)
19
internal static
JsonPropertyInfo
LookupProperty(
30
JsonPropertyInfo
? jsonPropertyInfo = jsonTypeInfo.GetProperty(
52
if (jsonTypeInfo.ExtensionDataProperty is
JsonPropertyInfo
{ HasGetter: true, HasSetter: true } dataExtProperty)
68
jsonPropertyInfo =
JsonPropertyInfo
.s_missingProperty;
107
JsonPropertyInfo
jsonPropertyInfo,
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (10)
209
JsonPropertyInfo
? jsonPropertyInfo = CreatePropertyInfo(typeInfo, typeToConvert, memberInfo, nullabilityCtx, typeInfo.Options, shouldCheckForRequiredKeyword, hasJsonIncludeAttribute);
222
private static
JsonPropertyInfo
? CreatePropertyInfo(
253
JsonPropertyInfo
jsonPropertyInfo = typeInfo.CreatePropertyUsingReflection(typeToConvert, declaringType: memberInfo.DeclaringType);
276
private static bool PropertyIsOverriddenAndIgnored(PropertyInfo propertyInfo, Dictionary<string,
JsonPropertyInfo
>? ignoredMembers)
279
ignoredMembers?.TryGetValue(propertyInfo.Name, out
JsonPropertyInfo
? ignoredMember) == true &&
323
JsonPropertyInfo
jsonPropertyInfo,
364
private static void DeterminePropertyPolicies(
JsonPropertyInfo
propertyInfo, MemberInfo memberInfo)
376
private static void DeterminePropertyName(
JsonPropertyInfo
propertyInfo, MemberInfo memberInfo)
401
private static void DeterminePropertyIsRequired(
JsonPropertyInfo
propertyInfo, MemberInfo memberInfo, bool shouldCheckForRequiredKeyword)
470
private static void DeterminePropertyNullability(
JsonPropertyInfo
propertyInfo, MemberInfo memberInfo, NullabilityInfoContext nullabilityCtx)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (2)
21
/// <returns>A <see cref="
JsonPropertyInfo
"/> instance initialized with the provided metadata.</returns>
23
public static
JsonPropertyInfo
CreatePropertyInfo<T>(JsonSerializerOptions options, JsonPropertyInfoValues<T> propertyInfo)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (4)
131
internal static void PopulateProperties(JsonTypeInfo typeInfo, JsonTypeInfo.JsonPropertyInfoList propertyList, Func<JsonSerializerContext,
JsonPropertyInfo
[]> propInitFunc)
139
JsonPropertyInfo
[] properties = propInitFunc(context!);
145
foreach (
JsonPropertyInfo
jsonPropertyInfo in properties)
202
JsonPropertyInfo
propertyInfo,
System\Text\Json\Serialization\Metadata\JsonObjectInfoValuesOfT.cs (1)
33
public Func<JsonSerializerContext,
JsonPropertyInfo
[]>? PropertyMetadataInitializer { get; init; }
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (3)
15
internal JsonParameterInfo(JsonParameterInfoValues parameterInfoValues,
JsonPropertyInfo
matchingProperty)
73
/// This setting is in sync with the associated <see cref="
JsonPropertyInfo
.IsSetNullable"/> property.
115
internal
JsonPropertyInfo
MatchingProperty { get; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (18)
18
internal static readonly
JsonPropertyInfo
s_missingProperty = GetPropertyPlaceholder();
40
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
64
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
83
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
110
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
155
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
232
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
268
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
307
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
339
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
386
internal static
JsonPropertyInfo
GetPropertyPlaceholder()
388
JsonPropertyInfo
info = new JsonPropertyInfo<object>(typeof(object), declaringTypeInfo: null, options: null!);
737
/// Creates a <see cref="
JsonPropertyInfo
"/> instance whose type matches that of the current property.
780
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
783
/// The value of <see cref="Name"/> cannot conflict with that of other <see cref="
JsonPropertyInfo
"/> defined in the declaring <see cref="JsonTypeInfo"/>.
827
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
1038
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
1092
internal bool IsOverriddenOrShadowedBy(
JsonPropertyInfo
other)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
87
/// Provides a <see cref="ICustomAttributeProvider"/> factory that maps to <see cref="
JsonPropertyInfo
.AttributeProvider"/>.
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (6)
43
internal ReadOnlySpan<
JsonPropertyInfo
> PropertyCache
52
private
JsonPropertyInfo
[]? _propertyCache;
55
internal Dictionary<string,
JsonPropertyInfo
> PropertyIndex
64
private Dictionary<string,
JsonPropertyInfo
>? _propertyIndex;
76
internal
JsonPropertyInfo
? GetProperty(ReadOnlySpan<byte> propertyName, ref ReadStackFrame frame, out byte[] utf8PropertyName)
145
if (PropertyIndex.TryLookupUtf8Key(propertyName, out
JsonPropertyInfo
? info) &&
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (36)
34
/// Negated bitmask of the required properties, indexed by <see cref="
JsonPropertyInfo
.PropertyIndex"/>.
234
/// Gets the list of <see cref="
JsonPropertyInfo
"/> metadata corresponding to the current type.
240
/// The order of <see cref="
JsonPropertyInfo
"/> entries in the list determines the serialization order,
241
/// unless either of the entries specifies a non-zero <see cref="
JsonPropertyInfo
.Order"/> value,
242
/// in which case the properties will be stable sorted by <see cref="
JsonPropertyInfo
.Order"/>.
244
/// It is required that added <see cref="
JsonPropertyInfo
"/> entries are unique up to <see cref="
JsonPropertyInfo
.Name"/>,
247
public IList<
JsonPropertyInfo
> Properties => PropertyList;
275
internal Func<JsonSerializerContext,
JsonPropertyInfo
[]>? SourceGenDelayedPropertyInitializer
286
private Func<JsonSerializerContext,
JsonPropertyInfo
[]>? _sourceGenDelayedPropertyInitializer;
356
internal
JsonPropertyInfo
? ExtensionDataProperty { get; private set; }
473
/// Dummy <see cref="
JsonPropertyInfo
"/> instance corresponding to the declaring type of this <see cref="JsonTypeInfo"/>.
483
internal
JsonPropertyInfo
PropertyInfoForTypeInfo { get; }
485
private protected abstract
JsonPropertyInfo
CreatePropertyInfoForTypeInfo();
637
/// The <see cref="
JsonPropertyInfo
"/> instance has been locked for further modification.
831
foreach (
JsonPropertyInfo
property in _properties)
976
/// Creates a blank <see cref="
JsonPropertyInfo
"/> instance for the current <see cref="JsonTypeInfo"/>.
980
/// <returns>A blank <see cref="
JsonPropertyInfo
"/> instance.</returns>
986
public
JsonPropertyInfo
CreateJsonPropertyInfo(Type propertyType, string name)
997
JsonPropertyInfo
propertyInfo = CreatePropertyUsingReflection(propertyType, declaringType: null);
1005
internal
JsonPropertyInfo
CreatePropertyUsingReflection(Type propertyType, Type? declaringType)
1007
JsonPropertyInfo
jsonPropertyInfo;
1021
jsonPropertyInfo = (
JsonPropertyInfo
)propertyInfoType.CreateInstanceNoWrapExceptions(
1033
private protected abstract
JsonPropertyInfo
CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options);
1051
public Dictionary<string, (
JsonPropertyInfo
, int index)> AddedProperties = new(options.PropertyNameCaseInsensitive ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal);
1052
public Dictionary<string,
JsonPropertyInfo
>? IgnoredProperties;
1074
Dictionary<string,
JsonPropertyInfo
> propertyIndex = new(properties.Count, comparer);
1075
List<
JsonPropertyInfo
> propertyCache = new(properties.Count);
1083
JsonPropertyInfo
property = properties[i];
1163
internal void ResolveMatchingParameterInfo(
JsonPropertyInfo
propertyInfo)
1192
foreach (
JsonPropertyInfo
propertyInfo in _propertyCache)
1357
internal sealed class JsonPropertyInfoList : ConfigurationList<
JsonPropertyInfo
>
1380
protected override void ValidateAddedValue(
JsonPropertyInfo
item)
1393
public void AddPropertyWithConflictResolution(
JsonPropertyInfo
jsonPropertyInfo, ref PropertyHierarchyResolutionState state)
1409
(
JsonPropertyInfo
other, int index) = state.AddedProperties[jsonPropertyInfo.Name];
1428
(state.IgnoredProperties?.TryGetValue(memberName, out
JsonPropertyInfo
? ignored) == true && jsonPropertyInfo.IsOverriddenOrShadowedBy(ignored));
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (3)
111
foreach (
JsonPropertyInfo
propertyInfo in PropertyList)
138
private protected override
JsonPropertyInfo
CreatePropertyInfoForTypeInfo()
150
private protected override
JsonPropertyInfo
CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (1)
100
foreach (
JsonPropertyInfo
property in derivedTypeInfo.JsonTypeInfo.Properties)
System\Text\Json\Serialization\Metadata\PropertyRef.cs (4)
11
/// Represents a UTF-8 encoded JSON property name and its associated <see cref="
JsonPropertyInfo
"/>, if available.
15
internal readonly struct PropertyRef(ulong key,
JsonPropertyInfo
? info, byte[] utf8PropertyName) : IEquatable<PropertyRef>
28
/// The <see cref="
JsonPropertyInfo
"/> associated with the property name, if available.
30
public readonly
JsonPropertyInfo
? Info = info;
System\Text\Json\Serialization\ReadStack.cs (1)
35
public readonly
JsonPropertyInfo
? ParentProperty
System\Text\Json\Serialization\ReadStackFrame.cs (2)
19
public
JsonPropertyInfo
? JsonPropertyInfo;
131
public void MarkPropertyAsRead(
JsonPropertyInfo
propertyInfo)
System\Text\Json\Serialization\WriteStackFrame.cs (1)
39
public
JsonPropertyInfo
? JsonPropertyInfo;
System\Text\Json\ThrowHelper.Serialization.cs (16)
86
public static void ThrowInvalidOperationException_ObjectCreationHandlingPopulateNotSupportedByConverter(
JsonPropertyInfo
propertyInfo)
92
public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyMustHaveAGetter(
JsonPropertyInfo
propertyInfo)
98
public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyValueTypeMustHaveASetter(
JsonPropertyInfo
propertyInfo)
104
public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization(
JsonPropertyInfo
propertyInfo)
110
public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowReadOnlyMember(
JsonPropertyInfo
propertyInfo)
273
public static void ThrowInvalidOperationException_SerializerPropertyNameNull(
JsonPropertyInfo
jsonPropertyInfo)
279
public static void ThrowInvalidOperationException_JsonPropertyRequiredAndNotDeserializable(
JsonPropertyInfo
jsonPropertyInfo)
285
public static void ThrowInvalidOperationException_JsonPropertyRequiredAndExtensionData(
JsonPropertyInfo
jsonPropertyInfo)
299
foreach (
JsonPropertyInfo
property in parent.PropertyCache)
327
public static void ThrowJsonException_DuplicatePropertyNotAllowed(
JsonPropertyInfo
property)
407
public static void ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam(string propertyName,
JsonPropertyInfo
jsonPropertyInfo)
425
public static void ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(
JsonPropertyInfo
jsonPropertyInfo)
583
public static void ThrowInvalidOperationException_ExtensionDataConflictsWithUnmappedMemberHandling(Type classType,
JsonPropertyInfo
jsonPropertyInfo)
589
public static void ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(
JsonPropertyInfo
jsonPropertyInfo)
595
public static void ThrowInvalidOperationException_PropertyTypeNotNullable(
JsonPropertyInfo
jsonPropertyInfo)
828
public static void ThrowInvalidOperationException_JsonPropertyInfoIsBoundToDifferentJsonTypeInfo(
JsonPropertyInfo
propertyInfo)