diff --git a/src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj b/src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj index aa265b229..3eeaa4dc8 100644 --- a/src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj +++ b/src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Confluent.SchemaRegistry.Serdes.Json/JsonSerializer.cs b/src/Confluent.SchemaRegistry.Serdes.Json/JsonSerializer.cs index 4a6a4a341..b7b4d587d 100644 --- a/src/Confluent.SchemaRegistry.Serdes.Json/JsonSerializer.cs +++ b/src/Confluent.SchemaRegistry.Serdes.Json/JsonSerializer.cs @@ -100,8 +100,13 @@ public JsonSerializer(ISchemaRegistryClient schemaRegistryClient, JsonSerializer this.jsonSchemaGeneratorSettings = jsonSchemaGeneratorSettings; this.schema = this.jsonSchemaGeneratorSettings == null +#if NET8_0_OR_GREATER + ? NewtonsoftJsonSchemaGenerator.FromType() + : NewtonsoftJsonSchemaGenerator.FromType(this.jsonSchemaGeneratorSettings); +#else ? JsonSchema.FromType() : JsonSchema.FromType(this.jsonSchemaGeneratorSettings); +#endif this.schemaText = schema.ToJson(); this.schemaFullname = schema.Title; @@ -185,7 +190,7 @@ public JsonSerializer(ISchemaRegistryClient schemaRegistryClient, Schema schema, /// Context relevant to the serialize operation. /// /// - /// A that completes with + /// A that completes with /// serialized as a byte array. /// public override async Task SerializeAsync(T value, SerializationContext context)