{"name":"node-request-by-swagger","version":"1.0.5","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":"c1acee81ec58d7b741a3c1c75c9f830d678fffe0","_id":"node-request-by-swagger@1.0.5","_shasum":"8778942080ab9c3ee453fc0a563dac3235d49a49","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"yarax","email":"raxpost@gmail.com"},"dist":{"shasum":"8778942080ab9c3ee453fc0a563dac3235d49a49","tarball":"http://registry-npm.ywwl.com/node-request-by-swagger/download/node-request-by-swagger-1.0.5.tgz","integrity":"sha512-rEdh3+IrKUd/JjONb1Nw/NFfZ+PfF6w9HuPtzoMM1XuzvY1as3XNxzQGEh9CMjCU6qHeRaEe1v7F8vuikztDvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWod/oJFnInvC/KhP9OPW4WnxJDYF0qEDWSNagshG5YAIgPRB2tZ6NJ17Lvsxk2cVKGYsDu3JHRQG/gVXeY+L+Zjs="}],"size":4468,"noattachment":false,"key":"/node-request-by-swagger/-/node-request-by-swagger-1.0.5.tgz"},"maintainers":[{"name":"yarax","email":"raxpost@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/node-request-by-swagger-1.0.5.tgz_1481214641867_0.3078664499334991"},"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":1481214643722,"_cnpm_publish_time":1481214643722,"dist-tags":{"latest":"1.1.4"}}