-
Make sure your WADL file is in the same directory under the name
wadl.xml
. -
Then, you can just run:
npm install
node wadl2swagger.js
- You'll get a Swagger file
swagger.json
. Then use the Swagger Importer to import the fie in Paw.
Make sure your WADL file is in the same directory under the name wadl.xml
.
Then, you can just run:
npm install
node wadl2swagger.js
swagger.json
. Then use the Swagger Importer to import the fie in Paw.{ | |
"name": "wadltest", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"wadl2json": "^1.0.3" | |
} | |
} |
var wadl2json = require("wadl2json"); | |
var fs = require('fs'); | |
var options = { | |
sort: false, // set it to true if you want to sort operations and verbs in the alphabetical order | |
stringify: true, // set it to true if you want to get a string instead of an object | |
prettify: true, // set it to true if you want to get an indented string (stringify=true required) | |
title: "Simple API", // the title of the API (required) | |
description: "Simple API description", // the description of the API (required) | |
version: "1.4.2", // the version of the API (required) | |
blacklist: ["/internal"] // the path roots you want to blacklist | |
}; | |
var swaggerFromFile = wadl2json.fromFile("./wadl.xml", options); | |
fs.writeFile('./swagger.json', swaggerFromFile); |