JsonSerializer.Deserialize will not translate number to string
I am trying to deserialize JSON into an object and one of the JSON values is a is sometimes a string and sometimes a number which will not translate into a string property of an object.
Previous forum questions recommend using the attribute JsonNumberHandling to translate possible numbers into strings but it doesn't seem to work in my simple example.
My usage:
My error:
System.InvalidOperationException: ''JsonNumberHandlingAttribute' is only valid on a number or a collection of numbers when applied to a property or field. See member 'position' on type 'Confluence.Domain.Info.Generator.Extensions'.'
Previous forum questions recommend using the attribute JsonNumberHandling to translate possible numbers into strings but it doesn't seem to work in my simple example.
My usage:
My error:
System.InvalidOperationException: ''JsonNumberHandlingAttribute' is only valid on a number or a collection of numbers when applied to a property or field. See member 'position' on type 'Confluence.Domain.Info.Generator.Extensions'.'