Closed sam3k closed 1 year ago
I may have overthought this.
import schema from './apiv3.json';
const api = await SwaggerParser.bundle(schema);
console.log(api); // works!!
I will keep this issue open till I have the functionality I have in mind implemented.
Closing this issue as my previous comment is the way to solve it.
I'm trying to use the Swagger parser in the browser and need to import a JSON schema file in a relative path instead of a HTTP get request. It will be served next to the app.js file to begin with and later i'll be loading from a NPM package that generates the JSON schema via some CI/CD build. (e.g.
node_modules/some_package/schema.json
);App structure (Typical React app):
Here is what I've tried so far:
Per the docs:
Is this not possible in browser mode?