Skip to content

Commit 8c19ef1

Browse files
author
dec.kolakowski
committed
feat: more clean up
1 parent 697f45b commit 8c19ef1

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎src/LEGO.AsyncAPI.Readers/AsyncApiExternalReferenceResolver.cs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ private void ResolveMap<T>(IDictionary<string, T> map)
211211
private T ResolveReference<T>(AsyncApiReference reference)
212212
where T : class, IAsyncApiReferenceable, new()
213213
{
214-
// this is where external references should be resolved with the provided interface
215-
// we need to load the external file and then read the fragment as if it were T
216-
// but if T also will that reference be unpopulated?
217214
if (reference.IsExternal)
218215
{
219216
// read external content

‎src/LEGO.AsyncAPI.Readers/AsyncApiJsonDocumentReader.cs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Copyright (c) The LEGO Group. All rights reserved.
22

3-
using LEGO.AsyncAPI.Services;
4-
53
namespace LEGO.AsyncAPI.Readers
64
{
75
using System.Collections.Generic;
@@ -14,6 +12,7 @@ namespace LEGO.AsyncAPI.Readers
1412
using LEGO.AsyncAPI.Models;
1513
using LEGO.AsyncAPI.Models.Interfaces;
1614
using LEGO.AsyncAPI.Readers.Interface;
15+
using LEGO.AsyncAPI.Services;
1716
using LEGO.AsyncAPI.Validations;
1817

1918
/// <summary>
@@ -94,6 +93,7 @@ public async Task<ReadResult> ReadAsync(JsonNode input, CancellationToken cancel
9493
// Parse the AsyncApi Document
9594
document = context.Parse(input);
9695
this.ResolveReferences(diagnostic, document);
96+
this.ResolveExternalReferences(diagnostic, document);
9797
}
9898
catch (AsyncApiException ex)
9999
{
@@ -209,7 +209,11 @@ private void ResolveExternalReferences(AsyncApiDiagnostic diagnostic, AsyncApiDo
209209
var resolver = new AsyncApiExternalReferenceResolver(document, this.settings);
210210
var walker = new AsyncApiWalker(resolver);
211211
walker.Walk(document);
212-
// return resolver.Errors;
212+
213+
foreach (var error in resolver.Errors)
214+
{
215+
diagnostic.Errors.Add(error);
216+
}
213217
}
214218
}
215219
}

0 commit comments

Comments
 (0)