You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[severity:It's more difficult to complete my work]
The TransformSchemaNode callback is called with wrong information in both parameters when more than one property uses a JsonConverter.
public sealed class TheConverter : JsonConverter<int>
{
public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => throw new NotImplementedException();
public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) => throw new NotImplementedException();
}
public sealed class TheClass
{
[JsonConverter(typeof(TheConverter))] public int Prop1 { get; set; }
[JsonConverter(typeof(TheConverter))] public int Prop2 { get; set; }
}
internal class Program
{
static void Main()
{
var jsonSchemaExporterOptions = new JsonSchemaExporterOptions
{
TransformSchemaNode = (context, schema) =>
{
Console.WriteLine($"path: $/{string. Join("/", context. Path.ToArray())}/, property name: {context. PropertyInfo?. Name}");
return schema;
},
};
var options = JsonSerializerOptions.Default;
var schema = options. GetJsonSchemaAsNode(typeof(TheClass), jsonSchemaExporterOptions);
Console.WriteLine(schema. ToString());
}
}
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered:
This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
The TransformSchemaNode callback is called with wrong information in both parameters when more than one property uses a JsonConverter.
Output is:
Output should be:
Original Comments
Feedback Bot on 19/11/2024, 03:31 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: