You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenApiStreamReader.ReadAsync() throws an InvalidOperation exception when using ResolveAllReferences #609
OpenApiStreamReader.ReadAsync() throws an InvalidOperation exception with the message "This operation is not supported for a relative URI." when using 'ReferenceResolutionSetting.ResolveAllReferences' flag.
what should the BaseUrl be set to ? currently I am not setting it not sure what I need to set it to.
I am using the yaml files defined in https://github.com/jdegre/5GC_APIs.
Hi Darrel (@darrelmiller), I have encountered the same issue. However, I wrote my own JSON preprocessor which correctly turned all relative paths into absolute ones. See here a public gist of the OpenAPI schema for ApplicationInsights
The error remains the same even though there no more relative paths in the initial document itself. Here is a dotnet fiddle snippet to reproduce the issue:
Another half solution I found is changing the custom resource loader when the initial schema url is known and is used as base path. (the following is in F# but you get the idea)
typeExternalResouceLoader(schema: string)=interface Interface.IStreamLoader withmemberself.Load(uri:Uri)=letabsoluteUri=ifnot uri.IsAbsoluteUri then
Uri(Uri(schema), uri.OriginalString)else
uri
httpClient.GetStreamAsync(absoluteUri)|> Async.AwaitTask
|> Async.RunSynchronously
memberself.LoadAsync(uri:Uri)=letabsoluteUri=ifnot uri.IsAbsoluteUri then
Uri(Uri(schema), uri.OriginalString)else
uri
httpClient.GetStreamAsync(absoluteUri)
However, the resolved parts are not really useful: types are not added to the global components and external parameters are empty (except for the Reference property)
Activity
darrelmiller commentedon Jun 25, 2021
As mentioned in the release notes currently remote references only works for absolute paths.
Zaid-Ajaj commentedon Jun 27, 2021
Hi Darrel (@darrelmiller), I have encountered the same issue. However, I wrote my own JSON preprocessor which correctly turned all relative paths into absolute ones. See here a public gist of the OpenAPI schema for ApplicationInsights
The error remains the same even though there no more relative paths in the initial document itself. Here is a dotnet fiddle snippet to reproduce the issue:
I guess the error still happens because one of the transitive documents itself has a relative path?
darrelmiller commentedon Jun 27, 2021
I'm working on fixing this at the moment. Thanks for the repro instructions.
Zaid-Ajaj commentedon Jun 27, 2021
Another half solution I found is changing the custom resource loader when the initial
schemaurl is known and is used as base path. (the following is in F# but you get the idea)However, the resolved parts are not really useful: types are not added to the global
componentsand external parameters are empty (except for theReferenceproperty)