New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpenAPI v3 #4

wants to merge 1 commit into
base: develop


None yet
3 participants

JonathanMontane commented Aug 27, 2017

Not Ready For Review

This PR will add an OpenAPI v3 Parser to API-Flow.

@philsturgeon It's being worked on!


This comment has been minimized.

philsturgeon commented Aug 28, 2017

Awesome! Can I help at all? I'll of course test things when it's considered readyish.


This comment has been minimized.


JonathanMontane commented Aug 28, 2017

@philsturgeon If you have shareable OpenAPI v3 files lying around, I'd love to have them as test-case for the e2e testing. Otherwise, if you're up for it, I'm looking to massively upgrade dependencies while trying not to break too many things.

As for your install issue, I believe the issue you're having with the installation stems from having used the npm package. It's outdated iirc, and I don't have the rights to publish on it anymore.

Here's the updated install step:

git clone
cd API-Flow
nvm use
yarn install

then you can make your runners. for instance, creating the node runner would be done like so:

make runners TARGET="node"
# you can create multiple targets in the same command
# make runners TARGET="node web webworker"

once you've created the node lib, you can use it like this:

const ApiFlow = require('./dist/node/api-flow.js').default; // the .default is due to es6 modules structure.

const options = {
    source: {
        format: 'swagger',
        version: 'v2.0'
    target: {
        format: 'raml',
        version: 'v1.0'

const promise = ApiFlow.transform({
  // this also works with file uri like: file:///some/path, or simply /some/path
  // check out -- it's amazing
  uri: ''

promise.then((data) => {

I just did all the steps, and it worked, so it should work for you too.

Note For some reason I had an Error: define cannot be used indirect bug when I did an npm install instead of a yarn install (with make runners generating warnings about /~/lib/ajv or something), so I'd recommend using yarn, although I'm not too sure how that got resolved.


This comment has been minimized.

MikeRalphson commented Sep 25, 2017

@JonathanMontane thanks for the mention of (I'm the current maintainer). You may not know that there is a static branch full of OpenAPI v3 conversions at

Eventually I'd like to replace use of api-spec-converter in the scripts with API-Flow.

Let me see if I can run the test-suite successfully (edit: unit tests running ok with a slight tweak to - still looking at e2e tests), then I can see about helping with dependency updates and possibly contributing to your OpenApiV3 work. I've currently got a loader and parser hacked from the Swagger2 equivalents, which is enough to validate an input V3 definition and produce reasonable looking output from the internal model, but I've only dealt with minor structural changes so far (scheme+host -> servers.url and definitions -> components.schemas).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment