{"name":"node-request-by-swagger","version":"1.0.3","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":"bcf6091ae28f048ba46a84551141ea20322954d6","_id":"node-request-by-swagger@1.0.3","_shasum":"0ed8a3a04ff507dd49663c5ed59b2986787c4b75","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"yarax","email":"raxpost@gmail.com"},"dist":{"shasum":"0ed8a3a04ff507dd49663c5ed59b2986787c4b75","tarball":"http://registry-npm.ywwl.com/node-request-by-swagger/download/node-request-by-swagger-1.0.3.tgz","integrity":"sha512-hXv9/mKrGjzdatV+2BqmLfadDk989ddue3PaKd0+RXFM9yU4rZmplTdce41ykcHMzMurQ2u9Kurp3BCHjIjFbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyGHJGK9BAFlbEK8Q+3n3lrTZduHxnw+CxpUbjL6UniAiAUo5MpvIZ+aC7HL2w0h0psMjByF8uuRIoZZTh6ZicnLQ=="}],"size":7198,"noattachment":false,"key":"/node-request-by-swagger/-/node-request-by-swagger-1.0.3.tgz"},"maintainers":[{"name":"yarax","email":"raxpost@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/node-request-by-swagger-1.0.3.tgz_1476614865871_0.09919669874943793"},"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":1476614867581,"_cnpm_publish_time":1476614867581,"dist-tags":{"latest":"1.1.4"}}