Table of Contents

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
JsonConverter
BlockedJsonInheritanceConverter
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

string

Methods

CanConvert(Type)

Determines whether this instance can convert the specified object type.

public override bool CanConvert(Type objectType)

Parameters

objectType Type

Type 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

reader JsonReader
objectType Type
existingValue object
serializer JsonSerializer

Returns

object

WriteJson(JsonWriter, object?, JsonSerializer)

Always throws an InvalidOperationException.

public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)

Parameters

writer JsonWriter
value object
serializer JsonSerializer