{"name":"node-request-by-swagger","version":"1.0.7","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":"b64875ae620978721186843b7db14cf0629cad70","_id":"node-request-by-swagger@1.0.7","_npmVersion":"5.4.2","_nodeVersion":"8.1.4","_npmUser":{"name":"yarax","email":"raxpost@gmail.com"},"dist":{"integrity":"sha512-MNa8A7Pz3SKeko4z4uHMeQUT6kCJGvL9W8BIkzDBRcIWlwpTDs4sJwVACggU/d3xOYnFP+DxHuClSe5r5YWWmA==","shasum":"c3367a40ea9226937c63ba7461c0ba45b5210dc7","tarball":"http://registry-npm.ywwl.com/node-request-by-swagger/download/node-request-by-swagger-1.0.7.tgz","fileCount":3,"unpackedSize":3665,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFwUS+O+O4Vpfw8Ti9lXfTlf75yv401CXXyM3QXyoWbkAiBBRsTCATU+z9Ex2j1ZRpnFFqrpjpkBa+ZQwCUi+JkQeA=="}],"size":1607,"noattachment":false,"key":"/node-request-by-swagger/-/node-request-by-swagger-1.0.7.tgz"},"maintainers":[{"name":"yarax","email":"raxpost@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-request-by-swagger_1.0.7_1519893414909_0.2589415287418304"},"_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":1519893415188,"_cnpm_publish_time":1519893415188,"dist-tags":{"latest":"1.1.4"}}