{"name":"node-request-by-swagger","version":"1.0.6","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":"085f18e0187fad3b8269793994815e42185b6538","_id":"node-request-by-swagger@1.0.6","_shasum":"3129510e33232e4d37be4cce94c704670bc5b135","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"yarax","email":"raxpost@gmail.com"},"dist":{"shasum":"3129510e33232e4d37be4cce94c704670bc5b135","tarball":"http://registry-npm.ywwl.com/node-request-by-swagger/download/node-request-by-swagger-1.0.6.tgz","integrity":"sha512-GUCtEweRBTuJYxNUYZWrSFTUuTJUxH+6ouWxnyp936aQInxTlHyCg9GEp/4JdePYV9fxH35o8idGxVpzymnzbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCnw2uEiIlP+bUYdelQhJRTwlCn0PYZVzcNTybbP4fsAiEAuhKGjLsTik/OPi8BOtmP0HFILGtYFSKET7j9rMXjU6c="}],"size":7197,"noattachment":false,"key":"/node-request-by-swagger/-/node-request-by-swagger-1.0.6.tgz"},"maintainers":[{"name":"yarax","email":"raxpost@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-request-by-swagger-1.0.6.tgz_1502485981400_0.7646456144284457"},"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":1502485982284,"_cnpm_publish_time":1502485982284,"dist-tags":{"latest":"1.1.4"}}