Comments (2)
...I am trying to convert all the files in a directory. I need to either run it for each file synchronously or somehow pass in extra data such as the output file name.
from api-spec-converter.
You have a couple options for running this inside a loop:
- You can use async/await syntax (requires Node v8):
(async function() {
for (let key in items) {
let converted = await Converter.convert({});
}
})();
- You can use the async library to run the conversions in series or in parallel (
async.series
orasync.parallel
)
For your second question, you do need to pass it a file or URL. The converter needs access to the underlying file because there are sometimes details that don't make it into the parsed object, e.g. in API Blueprint.
from api-spec-converter.
Related Issues (20)
- High vulnerability?
- the example value not convert
- how to convert open api 3.1 to swagger 2.0 HOT 1
- Online version returns TypeError: NetworkError when attempting to fetch resource.
- Sequence of schema fields are always ordered alphabetical
- Add original sort order as top fields ordering HOT 1
- not able to load the openapi 3 json definition
- https://github.com/LucyBot-Inc/api-spec-converter/pull/131#issue-259070526
- teste
- g
- Fails to generate valid OpenAPI from API Blueprint
- try to run project local
- Error in /var/www/node/node_modules/drafter.js/lib/drafter.nomem.js:1 HOT 2
- swagger_2 -> openapi_3: Crash when body parameter is missing schema
- convert open API3 to API 2
- Conversion to yml HOT 1
- Firestore discovery specification
- Application as a new Maintainer HOT 1
- TypeError: NetworkError when attempting to fetch resource.
- Test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-spec-converter.