<PackageReference Include="NJsonSchema" Version="10.0.26" />

AsyncJsonSchemaVisitorBase

Visitor to transform an object with JsonSchema objects.
using NJsonSchema.References; using System.Threading.Tasks; namespace NJsonSchema.Visitors { public abstract class AsyncJsonSchemaVisitorBase : AsyncJsonReferenceVisitorBase { protected abstract Task<JsonSchema> VisitSchemaAsync(JsonSchema schema, string path, string typeNameHint); protected override async Task<IJsonReference> VisitJsonReferenceAsync(IJsonReference reference, string path, string typeNameHint) { JsonSchema jsonSchema = reference as JsonSchema; if (jsonSchema != null) { ConfiguredTaskAwaiter val = AwaitExtensions.ConfigureAwait<JsonSchema>(VisitSchemaAsync(jsonSchema, path, typeNameHint), false).GetAwaiter(); if (!val.get_IsCompleted()) { await val; ConfiguredTaskAwaiter val2 = default(ConfiguredTaskAwaiter); val = val2; } return (IJsonReference)val.GetResult(); } return reference; } } }