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
When json-refs is used with it like this, there's no real way to fetch such references with a processContent function because PathLoader will try to resolve to process.cwd() and of course won't find such files.
What I suggest is providing an option for a simple function that gets an unmangled uri and then either returns an object (or error) as-is (synchronous), or returns a promise (asynchronous). You could name it customLoader or somesuch.
It could even have some matcher function to provide a way to validate whether to use the customLoader or fall back to PathLoader ending up with a simplest use-case (using the oaData from above) such as:
My use-case is that I have an object of objects, for which there are no real correspending files (let's say they come from a database), let's say:
and my refs are like:
When
json-refs
is used with it like this, there's no real way to fetch such references with aprocessContent
function becausePathLoader
will try to resolve toprocess.cwd()
and of course won't find such files.What I suggest is providing an option for a simple function that gets an unmangled uri and then either returns an object (or error) as-is (synchronous), or returns a promise (asynchronous). You could name it
customLoader
or somesuch.It could even have some matcher function to provide a way to validate whether to use the
customLoader
or fall back toPathLoader
ending up with a simplest use-case (using theoaData
from above) such as:or let's say from an async database loader such as:
The text was updated successfully, but these errors were encountered: