{"name":"node-request-by-swagger","version":"1.0.1","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":"c2d782b657c0a88d304bc7427b99dd1c9c62e3a9","_id":"node-request-by-swagger@1.0.1","_shasum":"ef4cd3f44aee19fa40798b88acf9ca997b02b548","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"yarax","email":"raxpost@gmail.com"},"dist":{"shasum":"ef4cd3f44aee19fa40798b88acf9ca997b02b548","tarball":"http://registry-npm.ywwl.com/node-request-by-swagger/download/node-request-by-swagger-1.0.1.tgz","integrity":"sha512-RhlnjnuVYdSBZEQ1aypuIJodkMEIKFflTvrakpZRnXTB3hMiA4BfFfW4Ud+Ex8SgubjDAIrr+3cttxjHMKQcZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/oVW+x/uKhA4Lr30CnEx7JuFZbuU6So8SAbhfiiLYnQIhALzugR14atk3LPKcfG1cYdfQ8/9oFHrfxHEUZH2KfXgC"}],"size":4387,"noattachment":false,"key":"/node-request-by-swagger/-/node-request-by-swagger-1.0.1.tgz"},"maintainers":[{"name":"yarax","email":"raxpost@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/node-request-by-swagger-1.0.1.tgz_1476613978315_0.39030839945189655"},"directories":{},"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":1476613980028,"_cnpm_publish_time":1476613980028,"dist-tags":{"latest":"1.1.4"}}