protected override DataModelValue ParseToDataModel(ref Exception?parseException) { try { return(DataModelConverter.FromJson(Value)); } catch (JsonException ex) { parseException = ex; return(Value.NormalizeSpaces()); } }
protected override async ValueTask <DataModelValue> ParseToDataModel(IExecutionContext executionContext, Resource resource, CancellationToken token) { var content = await resource.GetContent(token).ConfigureAwait(false); if (content is null) { return(DataModelValue.Null); } try { return(DataModelConverter.FromJson(content)); } catch (JsonException ex) { await executionContext.Log(LogLevel.Warning, exception : ex, token : token).ConfigureAwait(false); return(content.NormalizeSpaces()); } }