{"name":"node-request-by-swagger","version":"1.1.2","description":"Constructs request.js options from swagger endpoint","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yarax/node-request-by-swagger.git"},"keywords":["swagger","request","request.js"],"author":{"name":"Roman Krivtsov"},"license":"MIT","bugs":{"url":"https://github.com/yarax/node-request-by-swagger/issues"},"homepage":"https://github.com/yarax/node-request-by-swagger#readme","devDependencies":{"mocha":"^3.0.2","request":"^2.75.0"},"gitHead":"7da08de8be29f6b2d6e3b9382a8a91611654f696","_id":"node-request-by-swagger@1.1.2","_npmVersion":"5.6.0","_nodeVersion":"6.2.2","_npmUser":{"name":"yarax","email":"raxpost@gmail.com"},"dist":{"integrity":"sha512-E8wHi4FC986pN+zmAhdiHVtgUIE2fh84ZYjGdL3Iz/tI5pra/euxDz2kiHXpNYHaYZ/8qpZe+e4bJFT7ebd2Iw==","shasum":"e124a80b02b9cfd7b596167b84fe164be653de76","tarball":"http://registry-npm.ywwl.com/node-request-by-swagger/download/node-request-by-swagger-1.1.2.tgz","fileCount":12,"unpackedSize":40011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEV7dCRA9TVsSAnZWagAAlmAP/j0srQo8mwFUrt2tPdsM\nl2eKT3Y70S4A0bGiXKgEwDI1GLmBj3z2LM0CHo27QoWtA7f2QNRAeESe3ALL\nQEE0gRMQ7CDeK7Fzj3ulU/1fORvsO+asS0pcLOm8M4AZ5iHS1F3aUkrVGZd2\n2xPcFO3lbV8Gmi8gfWwkW1X/21djtnUyW2bc5SRQB5TXICXimkZTkOPjZ6fI\n+pAFZUA+mYibt06SNhGZawvAyDGBUMvf3aLqb3hGFbl6mvQs3Vsi7eYwsPKo\n2lL7w69IH24+n7pJdsXbcgdlojV2zU1EzvIpwQOrWmvaZq19Y6WfMkENmnIQ\npnzL+zhgtToixM4+gZDnewUn1d+wO6Ztk8r0g6pQ9m4uBCgXYIgqIrjH35lv\nccld7lqccsO3UBdF6IbpyJGUAN7n6Va6MJDOtJVh8bh0kMsOX7L+de4KVzc7\nWVyVV9BuGk4uX8NFy1fyvCfxIcfPHxbmWOzJnxdF36XEMtMUtrKniwq+9R/f\nF7GsNNTjT6YZo3fPHoDUrwFV6ilkC+0cUJA0CMSGFwfdhA1QuzrDkdbL44mX\nsYwM1RcFRrnVuIHutXco7i7HPpOy+fbvsQmIACmzXLsgukQ2VlH05BlfcEJO\nfbR/WpkmtmgQDb1u97Z2Vbd1HGJfEA/aNFh5t0+zJ4+AhRo1qVr70BQhlqZ6\nZMPK\r\n=Yt9J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEz67zXsGAENmdKhaeX/KkQda/nLNLpQwoWsH2uZJt8QIgRTEwePCI7ttbPVdgQnsAAu/I3v8Q/HZ5q7QDlRzjCak="}],"size":7950,"noattachment":false,"key":"/node-request-by-swagger/-/node-request-by-swagger-1.1.2.tgz"},"maintainers":[{"name":"yarax","email":"raxpost@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-request-by-swagger_1.1.2_1527865053073_0.20372753061614546"},"_hasShrinkwrap":false,"readme":"# Request by Swagger\n\nThe library constructs [request](https://github.com/request/request) options object, based on Swagger schema endpoint.\n\n## Objectives\n\nUsing REST one has to deal with many delivering data options: GET query, headers, body json, body multipart.\nAll of these options can be described using Swagger schema [parameters section](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject).\nThis library is an attempt to separate request logic from HTTP implementation details.\nSo you can consider you endpoint as a function, that takes some arguments\n\n## Install\n\n```\nnpm i --save node-request-by-swagger\n```\n\n## Usage\n\n```\nconst getRequestOptions = require('node-request-by-swagger');\nconst options = getRequestOptions(schema['/pet'].post, {\n    method: 'post',\n    baseUrl: `http://${schema.host}${schema.basePath}`,\n    path: '/pet',\n    args: {\n        body: {\n            name: 'bob'\n        }\n    },\n});\n\n```","publish_time":1527865053121,"_cnpm_publish_time":1527865053121,"dist-tags":{"latest":"1.1.4"}}