autodesk-forks-sway
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

autodesk-forks-sway

This package is a fork of apigee-127/sway. The purpose of this fork is to update dependencies and continue to maintain the original package.

Would you like to contribute? Read our contribution guidelines.

License: MIT NodeJS with Gulp semver npm version contributors

📖 Resources

Getting started

You can install this fork via npm:

npm i autodesk-forks-swagger-node-runner

Sample usage:

const Sway = require("autodesk-forks-sway");
const YAML = require('js-yaml');
const fs = require("fs");
const path = require("path");

Sway.create({
  definition: YAML.load(fs.readFileSync(path.join(__dirname, './test/browser/documents/2.0/swagger.yaml'), 'utf8')),
})
  .then(apiDef => {
    const goodParamValue = apiDef.getOperation('/pet/findByStatus', 'get').getParameter('status').getValue({
      query: {
        status: 'available'
      }
    });
    console.log(goodParamValue.valid); // will be true

    const badParamValue = apiDef.getOperation('/pet/findByStatus', 'get').getParameter('status').getValue({
      query: {
        status: 1
      }
    });
    console.log(badParamValue.valid); // will be false
  })
  .catch(console.error)

Readme

Keywords

Package Sidebar

Install

npm i autodesk-forks-sway

Weekly Downloads

71

Version

2.2.0

License

MIT

Unpacked Size

11 MB

Total Files

20

Last publish

Collaborators

  • danielg6666