Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Microsoft.OpenApi/Reader/OpenApiJsonReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ private JsonNode LoadJsonNodes(TextReader input)
private async Task<OpenApiDiagnostic> LoadExternalRefs(OpenApiDocument document, CancellationToken cancellationToken, OpenApiReaderSettings settings, string format = null)
{
// Create workspace for all documents to live in.
var openApiWorkSpace = new OpenApiWorkspace();
var baseUrl = settings.BaseUrl ?? new Uri(OpenApiConstants.BaseRegistryUri);
var openApiWorkSpace = new OpenApiWorkspace(baseUrl);

// Load this root document into the workspace
var streamLoader = new DefaultStreamLoader(settings.BaseUrl);
Expand Down
4 changes: 3 additions & 1 deletion src/Microsoft.OpenApi/Reader/Services/DefaultStreamLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public Stream Load(Uri uri)
/// <exception cref="ArgumentException"></exception>
public async Task<Stream> LoadAsync(Uri uri)
{
var absoluteUri = new Uri(baseUrl, uri);
Uri absoluteUri;
absoluteUri = baseUrl.AbsoluteUri.Equals(OpenApiConstants.BaseRegistryUri) ? new Uri(Directory.GetCurrentDirectory() + uri)
: new Uri(baseUrl, uri);

switch (absoluteUri.Scheme)
{
Expand Down
Loading