Class BlockedJsonInheritanceConverter
- Namespace
- JsonApiDotNetCore.OpenApi.Client.NSwag
- Assembly
- JsonApiDotNetCore.OpenApi.Client.NSwag.dll
Exists to block usage of the default
JsonInheritanceConverter
from NSwag, which is incompatible with JSON:API.
[PublicAPI]
public abstract class BlockedJsonInheritanceConverter : JsonConverter
- Inheritance
-
JsonConverterBlockedJsonInheritanceConverter
- Inherited Members
Constructors
BlockedJsonInheritanceConverter()
protected BlockedJsonInheritanceConverter()
BlockedJsonInheritanceConverter(string)
protected BlockedJsonInheritanceConverter(string discriminatorName)
Parameters
discriminatorName
string
Properties
CanRead
Gets a value indicating whether this Newtonsoft.Json.JsonConverter can read JSON.
public override bool CanRead { get; }
Property Value
- bool
true
if this Newtonsoft.Json.JsonConverter can read JSON; otherwise,false
.
CanWrite
Gets a value indicating whether this Newtonsoft.Json.JsonConverter can write JSON.
public override bool CanWrite { get; }
Property Value
- bool
true
if this Newtonsoft.Json.JsonConverter can write JSON; otherwise,false
.
DiscriminatorName
public string DiscriminatorName { get; }
Property Value
Methods
CanConvert(Type)
Determines whether this instance can convert the specified object type.
public override bool CanConvert(Type objectType)
Parameters
objectType
TypeType of the object.
Returns
- bool
true
if this instance can convert the specified object type; otherwise,false
.
ReadJson(JsonReader, Type, object?, JsonSerializer)
Always throws an InvalidOperationException.
public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
Parameters
Returns
WriteJson(JsonWriter, object?, JsonSerializer)
Always throws an InvalidOperationException.
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
Parameters
writer
JsonWritervalue
objectserializer
JsonSerializer