diesel-api-dsl 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/diesel.gemspec +1 -1
- data/lib/diesel/api_builder.rb +82 -32
- data/lib/diesel/api_group.rb +3 -2
- data/lib/diesel/middleware/auth/api_key.rb +13 -1
- data/lib/diesel/middleware/auth/basic.rb +27 -0
- data/lib/diesel/middleware/auth/oauth2.rb +2 -2
- data/lib/diesel/middleware/convert_json_body.rb +15 -0
- data/lib/diesel/middleware/set_body_parameter.rb +5 -1
- data/lib/diesel/middleware/set_path_parameter.rb +2 -1
- data/lib/diesel/request_context.rb +7 -1
- data/lib/diesel/swagger/definition.rb +1 -1
- data/lib/diesel/swagger/operation.rb +3 -1
- data/lib/diesel/swagger/parser.rb +25 -9
- data/lib/diesel/uri.rb +36 -0
- data/lib/diesel/version.rb +1 -1
- data/spec/diesel/api_builder_spec.rb +9 -3
- data/spec/diesel/swagger/parser_spec.rb +14 -0
- data/spec/diesel_spec.rb +173 -56
- data/spec/files/github.json +186 -0
- data/spec/files/harvest.json +75 -0
- data/spec/files/mandrill.json +502 -0
- data/spec/files/uber.json +43 -0
- data/spec/fixtures/vcr_cassettes/github_checkAuthorization.yml +71 -0
- data/spec/fixtures/vcr_cassettes/github_getUser.yml +82 -0
- data/spec/fixtures/vcr_cassettes/harvest_invoiceList.yml +85 -0
- data/spec/fixtures/vcr_cassettes/mandrill_userPing.yml +44 -0
- data/spec/fixtures/vcr_cassettes/uber_getProducts.yml +60 -0
- data/spec/spec_helper.rb +1 -0
- metadata +28 -6
| @@ -0,0 +1,43 @@ | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
              "swagger": "2.0",
         | 
| 3 | 
            +
             | 
| 4 | 
            +
              "info": {
         | 
| 5 | 
            +
                "title": "Uber",
         | 
| 6 | 
            +
                "version": "1"
         | 
| 7 | 
            +
              },
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              "host": "api.uber.com",
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              "basePath": "/v1",
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              "schemes": ["https"],
         | 
| 14 | 
            +
             | 
| 15 | 
            +
              "produces": ["application/json"],
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              "securityDefinitions": {
         | 
| 18 | 
            +
                "server_token": {
         | 
| 19 | 
            +
                  "type": "apiKey",
         | 
| 20 | 
            +
                  "name": "Authorization",
         | 
| 21 | 
            +
                  "in": "header",
         | 
| 22 | 
            +
                  "x-format": "Token %s"
         | 
| 23 | 
            +
                }
         | 
| 24 | 
            +
              },
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              "paths": {
         | 
| 27 | 
            +
                "/products": {
         | 
| 28 | 
            +
                  "get": {
         | 
| 29 | 
            +
                    "summary": "Return information about products offered at a given location.",
         | 
| 30 | 
            +
                    "operationId": "getProducts",
         | 
| 31 | 
            +
                    "parameters": [{
         | 
| 32 | 
            +
                      "name": "latitude",
         | 
| 33 | 
            +
                      "in": "query",
         | 
| 34 | 
            +
                      "type": "number"
         | 
| 35 | 
            +
                    }, {
         | 
| 36 | 
            +
                      "name": "longitude",
         | 
| 37 | 
            +
                      "in": "query",
         | 
| 38 | 
            +
                      "type": "number"
         | 
| 39 | 
            +
                    }]
         | 
| 40 | 
            +
                  }
         | 
| 41 | 
            +
                }
         | 
| 42 | 
            +
              }
         | 
| 43 | 
            +
            }
         | 
| @@ -0,0 +1,71 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://afakeclientid:afakeclientsecret@api.github.com/applications/afakeclientid/tokens/afakeaccesstoken
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  User-Agent:
         | 
| 11 | 
            +
                  - diesel-rb/0.1.3
         | 
| 12 | 
            +
                  Content-Type:
         | 
| 13 | 
            +
                  - application/json
         | 
| 14 | 
            +
              response:
         | 
| 15 | 
            +
                status:
         | 
| 16 | 
            +
                  code: 200
         | 
| 17 | 
            +
                  message: OK
         | 
| 18 | 
            +
                headers:
         | 
| 19 | 
            +
                  Server:
         | 
| 20 | 
            +
                  - GitHub.com
         | 
| 21 | 
            +
                  Date:
         | 
| 22 | 
            +
                  - Tue, 18 Aug 2015 02:56:24 GMT
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '1309'
         | 
| 27 | 
            +
                  Status:
         | 
| 28 | 
            +
                  - 200 OK
         | 
| 29 | 
            +
                  X-Ratelimit-Limit:
         | 
| 30 | 
            +
                  - '5000'
         | 
| 31 | 
            +
                  X-Ratelimit-Remaining:
         | 
| 32 | 
            +
                  - '4999'
         | 
| 33 | 
            +
                  X-Ratelimit-Reset:
         | 
| 34 | 
            +
                  - '1439870184'
         | 
| 35 | 
            +
                  Cache-Control:
         | 
| 36 | 
            +
                  - public, max-age=60, s-maxage=60
         | 
| 37 | 
            +
                  Etag:
         | 
| 38 | 
            +
                  - '"b01bb31a7fef3a65b8e2a9de29e0d677"'
         | 
| 39 | 
            +
                  Vary:
         | 
| 40 | 
            +
                  - Accept
         | 
| 41 | 
            +
                  - Accept-Encoding
         | 
| 42 | 
            +
                  X-Github-Media-Type:
         | 
| 43 | 
            +
                  - github.v3; format=json
         | 
| 44 | 
            +
                  X-Xss-Protection:
         | 
| 45 | 
            +
                  - 1; mode=block
         | 
| 46 | 
            +
                  X-Frame-Options:
         | 
| 47 | 
            +
                  - deny
         | 
| 48 | 
            +
                  Content-Security-Policy:
         | 
| 49 | 
            +
                  - default-src 'none'
         | 
| 50 | 
            +
                  Access-Control-Allow-Credentials:
         | 
| 51 | 
            +
                  - 'true'
         | 
| 52 | 
            +
                  Access-Control-Expose-Headers:
         | 
| 53 | 
            +
                  - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
         | 
| 54 | 
            +
                    X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
         | 
| 55 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 56 | 
            +
                  - "*"
         | 
| 57 | 
            +
                  X-Github-Request-Id:
         | 
| 58 | 
            +
                  - 49CF3EF9:5BAA:D3D5490:55D29ED8
         | 
| 59 | 
            +
                  Strict-Transport-Security:
         | 
| 60 | 
            +
                  - max-age=31536000; includeSubdomains; preload
         | 
| 61 | 
            +
                  X-Content-Type-Options:
         | 
| 62 | 
            +
                  - nosniff
         | 
| 63 | 
            +
                  X-Served-By:
         | 
| 64 | 
            +
                  - 2811da37fbdda4367181b328b22b2499
         | 
| 65 | 
            +
                body:
         | 
| 66 | 
            +
                  encoding: UTF-8
         | 
| 67 | 
            +
                  string: '{"id":19507702,"url":"https://api.github.com/authorizations/19507702","app":{"name":"IncomingHQ
         | 
| 68 | 
            +
                    (development)","url":"http://incominghq.com","client_id":"f085b1bcf0b7d2daca8d"},"token":"a19b557c75beed59278048da5acd20a17f77692e","hashed_token":"6a73d32e7c979ebe32e4617ca9f4960bb3442619ffe6d9ddc4b5436305e705be","token_last_eight":"7f77692e","note":null,"note_url":null,"created_at":"2015-06-26T12:29:59Z","updated_at":"2015-08-16T15:07:59Z","scopes":["read:org","repo:status"],"fingerprint":null,"user":{"login":"cyu","id":2431,"avatar_url":"https://avatars.githubusercontent.com/u/2431?v=3","gravatar_id":"","url":"https://api.github.com/users/cyu","html_url":"https://github.com/cyu","followers_url":"https://api.github.com/users/cyu/followers","following_url":"https://api.github.com/users/cyu/following{/other_user}","gists_url":"https://api.github.com/users/cyu/gists{/gist_id}","starred_url":"https://api.github.com/users/cyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyu/subscriptions","organizations_url":"https://api.github.com/users/cyu/orgs","repos_url":"https://api.github.com/users/cyu/repos","events_url":"https://api.github.com/users/cyu/events{/privacy}","received_events_url":"https://api.github.com/users/cyu/received_events","type":"User","site_admin":false}}'
         | 
| 69 | 
            +
                http_version: 
         | 
| 70 | 
            +
              recorded_at: Tue, 18 Aug 2015 02:56:24 GMT
         | 
| 71 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,82 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://api.github.com/user
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  User-Agent:
         | 
| 11 | 
            +
                  - diesel-rb/0.1.3
         | 
| 12 | 
            +
                  Content-Type:
         | 
| 13 | 
            +
                  - application/json
         | 
| 14 | 
            +
                  Authorization:
         | 
| 15 | 
            +
                  - Bearer afaketoken
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Server:
         | 
| 22 | 
            +
                  - GitHub.com
         | 
| 23 | 
            +
                  Date:
         | 
| 24 | 
            +
                  - Sun, 16 Aug 2015 11:44:41 GMT
         | 
| 25 | 
            +
                  Content-Type:
         | 
| 26 | 
            +
                  - application/json; charset=utf-8
         | 
| 27 | 
            +
                  Content-Length:
         | 
| 28 | 
            +
                  - '1097'
         | 
| 29 | 
            +
                  Status:
         | 
| 30 | 
            +
                  - 200 OK
         | 
| 31 | 
            +
                  X-Ratelimit-Limit:
         | 
| 32 | 
            +
                  - '5000'
         | 
| 33 | 
            +
                  X-Ratelimit-Remaining:
         | 
| 34 | 
            +
                  - '4999'
         | 
| 35 | 
            +
                  X-Ratelimit-Reset:
         | 
| 36 | 
            +
                  - '1439729081'
         | 
| 37 | 
            +
                  Cache-Control:
         | 
| 38 | 
            +
                  - private, max-age=60, s-maxage=60
         | 
| 39 | 
            +
                  Last-Modified:
         | 
| 40 | 
            +
                  - Thu, 30 Jul 2015 10:31:45 GMT
         | 
| 41 | 
            +
                  Etag:
         | 
| 42 | 
            +
                  - '"9d21057f20dc65085a97b97880dba697"'
         | 
| 43 | 
            +
                  X-Oauth-Scopes:
         | 
| 44 | 
            +
                  - read:org, repo:status
         | 
| 45 | 
            +
                  X-Accepted-Oauth-Scopes:
         | 
| 46 | 
            +
                  - ''
         | 
| 47 | 
            +
                  X-Oauth-Client-Id:
         | 
| 48 | 
            +
                  - xxx
         | 
| 49 | 
            +
                  Vary:
         | 
| 50 | 
            +
                  - Accept, Authorization, Cookie, X-GitHub-OTP
         | 
| 51 | 
            +
                  - Accept-Encoding
         | 
| 52 | 
            +
                  X-Github-Media-Type:
         | 
| 53 | 
            +
                  - github.v3; format=json
         | 
| 54 | 
            +
                  X-Xss-Protection:
         | 
| 55 | 
            +
                  - 1; mode=block
         | 
| 56 | 
            +
                  X-Frame-Options:
         | 
| 57 | 
            +
                  - deny
         | 
| 58 | 
            +
                  Content-Security-Policy:
         | 
| 59 | 
            +
                  - default-src 'none'
         | 
| 60 | 
            +
                  Access-Control-Allow-Credentials:
         | 
| 61 | 
            +
                  - 'true'
         | 
| 62 | 
            +
                  Access-Control-Expose-Headers:
         | 
| 63 | 
            +
                  - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
         | 
| 64 | 
            +
                    X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
         | 
| 65 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 66 | 
            +
                  - "*"
         | 
| 67 | 
            +
                  X-Github-Request-Id:
         | 
| 68 | 
            +
                  - 49CF3EF9:7C7A:4DC7847:55D077A9
         | 
| 69 | 
            +
                  Strict-Transport-Security:
         | 
| 70 | 
            +
                  - max-age=31536000; includeSubdomains; preload
         | 
| 71 | 
            +
                  X-Content-Type-Options:
         | 
| 72 | 
            +
                  - nosniff
         | 
| 73 | 
            +
                  X-Served-By:
         | 
| 74 | 
            +
                  - 173530fed4bbeb1e264b2ed22e8b5c20
         | 
| 75 | 
            +
                body:
         | 
| 76 | 
            +
                  encoding: UTF-8
         | 
| 77 | 
            +
                  string: '{"login":"cyu","id":2431,"avatar_url":"https://avatars.githubusercontent.com/u/2431?v=3","gravatar_id":"","url":"https://api.github.com/users/cyu","html_url":"https://github.com/cyu","followers_url":"https://api.github.com/users/cyu/followers","following_url":"https://api.github.com/users/cyu/following{/other_user}","gists_url":"https://api.github.com/users/cyu/gists{/gist_id}","starred_url":"https://api.github.com/users/cyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyu/subscriptions","organizations_url":"https://api.github.com/users/cyu/orgs","repos_url":"https://api.github.com/users/cyu/repos","events_url":"https://api.github.com/users/cyu/events{/privacy}","received_events_url":"https://api.github.com/users/cyu/received_events","type":"User","site_admin":false,"name":"Calvin
         | 
| 78 | 
            +
                    Yu","company":"Scoutmob","blog":"http://blog.codeeg.com","location":"Atlanta,
         | 
| 79 | 
            +
                    GA","email":"me@sourcebender.com","hireable":null,"bio":null,"public_repos":54,"public_gists":18,"followers":30,"following":7,"created_at":"2008-03-06T18:28:14Z","updated_at":"2015-07-30T10:31:45Z"}'
         | 
| 80 | 
            +
                http_version: 
         | 
| 81 | 
            +
              recorded_at: Sun, 16 Aug 2015 11:44:42 GMT
         | 
| 82 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,85 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://fakedomain.harvestapp.com/invoices
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  User-Agent:
         | 
| 11 | 
            +
                  - diesel-rb/0.1.4
         | 
| 12 | 
            +
                  Accept:
         | 
| 13 | 
            +
                  - application/json
         | 
| 14 | 
            +
                  Authorization:
         | 
| 15 | 
            +
                  - Bearer faketoken 
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Server:
         | 
| 22 | 
            +
                  - nginx
         | 
| 23 | 
            +
                  Date:
         | 
| 24 | 
            +
                  - Wed, 04 Nov 2015 14:19:44 GMT
         | 
| 25 | 
            +
                  Content-Type:
         | 
| 26 | 
            +
                  - application/json; charset=utf-8
         | 
| 27 | 
            +
                  Transfer-Encoding:
         | 
| 28 | 
            +
                  - chunked
         | 
| 29 | 
            +
                  Connection:
         | 
| 30 | 
            +
                  - keep-alive
         | 
| 31 | 
            +
                  Status:
         | 
| 32 | 
            +
                  - 200 OK
         | 
| 33 | 
            +
                  X-Frame-Options:
         | 
| 34 | 
            +
                  - SAMEORIGIN
         | 
| 35 | 
            +
                  X-Xss-Protection:
         | 
| 36 | 
            +
                  - 1; mode=block
         | 
| 37 | 
            +
                  X-Content-Type-Options:
         | 
| 38 | 
            +
                  - nosniff
         | 
| 39 | 
            +
                  Cache-Control:
         | 
| 40 | 
            +
                  - private, no-store, no-cache, max-age=0, must-revalidate
         | 
| 41 | 
            +
                  P3p:
         | 
| 42 | 
            +
                  - 'CP="Our privacy policy is available online: https://www.getharvest.com/services/privacy-policy"'
         | 
| 43 | 
            +
                  Content-Security-Policy:
         | 
| 44 | 
            +
                  - referrer origin-when-crossorigin
         | 
| 45 | 
            +
                  Content-Security-Policy-Report-Only:
         | 
| 46 | 
            +
                  - report-uri /csp_reports?authenticity_token=SFA%2FoMXIX0JQuAwnNhuaumd%2FRxxSAdFoVdI%2Bzc4Gbo4%3D;
         | 
| 47 | 
            +
                    default-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' cache.harvestapp.com
         | 
| 48 | 
            +
                    www.googletagmanager.com www.googleadservices.com platform.twitter.com *.google-analytics.com
         | 
| 49 | 
            +
                    www.google.com js-agent.newrelic.com *.nr-data.net js.appcenter.intuit.com
         | 
| 50 | 
            +
                    ajax.googleapis.com; style-src 'self' 'unsafe-inline' cache.harvestapp.com
         | 
| 51 | 
            +
                    www.google.com js.appcenter.intuit.com
         | 
| 52 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 53 | 
            +
                  - http://localhost:4567/auth/swagger/callback
         | 
| 54 | 
            +
                  Access-Control-Expose-Headers:
         | 
| 55 | 
            +
                  - X-Served-From,X-Company-Version,X-Asked-With-Method
         | 
| 56 | 
            +
                  Access-Control-Allow-Headers:
         | 
| 57 | 
            +
                  - Content-Type,Accept
         | 
| 58 | 
            +
                  Access-Control-Max-Age:
         | 
| 59 | 
            +
                  - '1200'
         | 
| 60 | 
            +
                  X-Served-From:
         | 
| 61 | 
            +
                  - https://fakedomain.harvestapp.com/invoices
         | 
| 62 | 
            +
                  Set-Cookie:
         | 
| 63 | 
            +
                  - _harvest_sess=UXR4Q0E4Y3c2RDJaRlFTVzlEWTNLTGErRnlDOEFtcTMvZHZFSEordXJLc3BBOXptc045UTZXL3RGVUhVUWhuTGFRZktCOGhkbUxzZitTWTkzOG5aMXRNYmNWZGFBZmNrQisveGE0M01QRWRYa3F4d3o3Qkw3WklGVFk4NU9TM1ZVaDlZejZ2R252cG9MZWcxRjlZdFRyV1MwYnlRQ1Bod1dNSE5HK2FZVWlid0Q5RnlDK1BzODZtT3Z1OGJHNDBNeEVpSXVvRnFDeTRIQmcwSFNIcW9SK29ZaVdFZE8vemwzSmpHL1FaeHB5TT0tLXk2MWFyTGlnQlJoclp5bTlJZjdPK1E9PQ%3D%3D--fe2967ef94293551fbb2b2e61f42a2fde20add6e;
         | 
| 64 | 
            +
                    domain=harvestapp.com; path=/; expires=Thu, 19 Nov 2015 14:19:44 -0000; secure;
         | 
| 65 | 
            +
                    HttpOnly
         | 
| 66 | 
            +
                  X-Request-Id:
         | 
| 67 | 
            +
                  - 7b38e38c-1581-4edb-95ce-2471b8e976bf
         | 
| 68 | 
            +
                  X-Runtime:
         | 
| 69 | 
            +
                  - '0.183979'
         | 
| 70 | 
            +
                  X-Server:
         | 
| 71 | 
            +
                  - rails5
         | 
| 72 | 
            +
                  X-Lb:
         | 
| 73 | 
            +
                  - lb1
         | 
| 74 | 
            +
                  Strict-Transport-Security:
         | 
| 75 | 
            +
                  - max-age=31536000; includeSubDomains
         | 
| 76 | 
            +
                body:
         | 
| 77 | 
            +
                  encoding: UTF-8
         | 
| 78 | 
            +
                  string: '[{"invoices":{"id":1,"client_id":123,"period_start":"2015-10-16","period_end":"2015-10-31","number":"60","issued_at":"2015-11-02","due_at":"2015-11-17","amount":20.0,"currency":"United
         | 
| 79 | 
            +
                    States Dollar - USD","state":"draft","notes":"","purchase_order":"","due_amount":20.0,"due_at_human_format":"net
         | 
| 80 | 
            +
                    15","created_at":"2015-11-03T02:27:53Z","updated_at":"2015-11-03T02:27:53Z","tax":null,"tax_amount":0.0,"subject":"","recurring_invoice_id":null,"tax2":null,"tax2_amount":0.0,"client_key":"abcd","estimate_id":null,"discount":null,"discount_amount":0.0,"retainer_id":null,"created_by_id":6,"project_id":null,"client_name":"Fake Client 1"}},{"invoices":{"id":2,"client_id":321,"period_start":"2015-10-16","period_end":"2015-10-31","number":"59","issued_at":"2015-11-02","due_at":"2015-11-17","amount":30.0,"currency":"United
         | 
| 81 | 
            +
                    States Dollar - USD","state":"open","notes":"","purchase_order":"","due_amount":30.0,"due_at_human_format":"net
         | 
| 82 | 
            +
                    15","created_at":"2015-11-03T02:26:47Z","updated_at":"2015-11-03T02:26:57Z","tax":null,"tax_amount":0.0,"subject":"","recurring_invoice_id":null,"tax2":null,"tax2_amount":0.0,"client_key":"abcd","estimate_id":null,"discount":null,"discount_amount":0.0,"retainer_id":null,"created_by_id":6,"project_id":null,"client_name":"Fake Client 2"}}]'
         | 
| 83 | 
            +
                http_version: 
         | 
| 84 | 
            +
              recorded_at: Wed, 04 Nov 2015 14:19:44 GMT
         | 
| 85 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,44 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: post
         | 
| 5 | 
            +
                uri: https://mandrillapp.com/api/1.0/users/ping.json
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: UTF-8
         | 
| 8 | 
            +
                  string: '{"key":"fakekey"}'
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  User-Agent:
         | 
| 11 | 
            +
                  - diesel-rb/0.1.4
         | 
| 12 | 
            +
                  Content-Type:
         | 
| 13 | 
            +
                  - application/json
         | 
| 14 | 
            +
                  Accept:
         | 
| 15 | 
            +
                  - application/json
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Server:
         | 
| 22 | 
            +
                  - nginx/1.8.0
         | 
| 23 | 
            +
                  Date:
         | 
| 24 | 
            +
                  - Wed, 04 Nov 2015 14:31:22 GMT
         | 
| 25 | 
            +
                  Content-Type:
         | 
| 26 | 
            +
                  - application/json; charset=utf-8
         | 
| 27 | 
            +
                  Transfer-Encoding:
         | 
| 28 | 
            +
                  - chunked
         | 
| 29 | 
            +
                  Vary:
         | 
| 30 | 
            +
                  - Accept-Encoding
         | 
| 31 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 32 | 
            +
                  - "*"
         | 
| 33 | 
            +
                  Access-Control-Allow-Methods:
         | 
| 34 | 
            +
                  - POST, GET, OPTIONS
         | 
| 35 | 
            +
                  Access-Control-Allow-Headers:
         | 
| 36 | 
            +
                  - Content-Type
         | 
| 37 | 
            +
                  Access-Control-Allow-Credentials:
         | 
| 38 | 
            +
                  - 'false'
         | 
| 39 | 
            +
                body:
         | 
| 40 | 
            +
                  encoding: UTF-8
         | 
| 41 | 
            +
                  string: '"PONG!"'
         | 
| 42 | 
            +
                http_version: 
         | 
| 43 | 
            +
              recorded_at: Wed, 04 Nov 2015 14:31:23 GMT
         | 
| 44 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,60 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://api.uber.com/v1/products?latitude=33.776776&longitude=-84.389683
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  User-Agent:
         | 
| 11 | 
            +
                  - diesel-rb/0.1.3
         | 
| 12 | 
            +
                  Content-Type:
         | 
| 13 | 
            +
                  - application/json
         | 
| 14 | 
            +
                  Authorization:
         | 
| 15 | 
            +
                  - Token TEST_SERVER_TOKEN
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Server:
         | 
| 22 | 
            +
                  - nginx
         | 
| 23 | 
            +
                  Date:
         | 
| 24 | 
            +
                  - Fri, 18 Sep 2015 04:02:36 GMT
         | 
| 25 | 
            +
                  Content-Type:
         | 
| 26 | 
            +
                  - application/json
         | 
| 27 | 
            +
                  Content-Length:
         | 
| 28 | 
            +
                  - '2079'
         | 
| 29 | 
            +
                  Connection:
         | 
| 30 | 
            +
                  - keep-alive
         | 
| 31 | 
            +
                  X-Rate-Limit-Remaining:
         | 
| 32 | 
            +
                  - '999'
         | 
| 33 | 
            +
                  Content-Language:
         | 
| 34 | 
            +
                  - en
         | 
| 35 | 
            +
                  Etag:
         | 
| 36 | 
            +
                  - '"8b714beb16ec06c6c555ae761aee791ecc20ea3a"'
         | 
| 37 | 
            +
                  X-Rate-Limit-Reset:
         | 
| 38 | 
            +
                  - '1442552400'
         | 
| 39 | 
            +
                  X-Rate-Limit-Limit:
         | 
| 40 | 
            +
                  - '1000'
         | 
| 41 | 
            +
                  X-Uber-App:
         | 
| 42 | 
            +
                  - uberex-nonsandbox
         | 
| 43 | 
            +
                  Strict-Transport-Security:
         | 
| 44 | 
            +
                  - max-age=0
         | 
| 45 | 
            +
                  X-Xss-Protection:
         | 
| 46 | 
            +
                  - 1; mode=block
         | 
| 47 | 
            +
                body:
         | 
| 48 | 
            +
                  encoding: UTF-8
         | 
| 49 | 
            +
                  string: '{"products":[{"capacity":4,"product_id":"6d898741-0175-4c71-ad5f-93fc66270d6a","price_details":{"service_fees":[{"fee":1.0,"name":"Safe
         | 
| 50 | 
            +
                    rides fee"}],"cost_per_minute":0.16,"distance_unit":"mile","minimum":5.0,"cost_per_distance":0.78,"base":1.15,"cancellation_fee":6.0,"currency_code":"USD"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-uberx.png","display_name":"uberX","description":"The
         | 
| 51 | 
            +
                    low-cost Uber"},{"capacity":6,"product_id":"171a12a5-5b08-40cc-bfb0-416b9256147a","price_details":{"service_fees":[{"fee":1.0,"name":"Safe
         | 
| 52 | 
            +
                    rides fee"}],"cost_per_minute":0.3,"distance_unit":"mile","minimum":8.0,"cost_per_distance":1.9,"base":3.0,"cancellation_fee":6.0,"currency_code":"USD"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-uberxl2.png","display_name":"uberXL","description":"Low-Cost
         | 
| 53 | 
            +
                    Rides for Larger Groups"},{"capacity":4,"product_id":"3d3dff24-c799-45ba-ad08-3d72c5b843b1","price_details":{"service_fees":[{"fee":1.0,"name":"Safe
         | 
| 54 | 
            +
                    rides fee"}],"cost_per_minute":0.35,"distance_unit":"mile","minimum":10.0,"cost_per_distance":2.0,"base":4.0,"cancellation_fee":10.0,"currency_code":"USD"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-uberselect.png","display_name":"UberSELECT","description":"The
         | 
| 55 | 
            +
                    Next Step Towards Luxury"},{"capacity":4,"product_id":"aff35634-a71e-470f-8c7b-703dec02e15b","price_details":{"service_fees":[],"cost_per_minute":0.4,"distance_unit":"mile","minimum":15.0,"cost_per_distance":3.25,"base":7.0,"cancellation_fee":10.0,"currency_code":"USD"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-black.png","display_name":"UberBLACK","description":"The
         | 
| 56 | 
            +
                    original Uber"},{"capacity":6,"product_id":"852310f8-a778-4191-bb7b-8c5f9a9899f6","price_details":{"service_fees":[],"cost_per_minute":0.5,"distance_unit":"mile","minimum":25.0,"cost_per_distance":4.0,"base":14.0,"cancellation_fee":10.0,"currency_code":"USD"},"image":"http:\/\/d1a3f4spazzrp4.cloudfront.net\/car-types\/mono\/mono-suv.png","display_name":"UberSUV","description":"Room
         | 
| 57 | 
            +
                    for everyone"}]}'
         | 
| 58 | 
            +
                http_version: 
         | 
| 59 | 
            +
              recorded_at: Fri, 18 Sep 2015 04:02:36 GMT
         | 
| 60 | 
            +
            recorded_with: VCR 2.9.3
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: diesel-api-dsl
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Calvin Yu
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015- | 
| 11 | 
            +
            date: 2015-11-04 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -98,16 +98,16 @@ dependencies: | |
| 98 98 | 
             
              name: multi_json
         | 
| 99 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 100 | 
             
                requirements:
         | 
| 101 | 
            -
                - - " | 
| 101 | 
            +
                - - ">="
         | 
| 102 102 | 
             
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: 1. | 
| 103 | 
            +
                    version: '1.3'
         | 
| 104 104 | 
             
              type: :runtime
         | 
| 105 105 | 
             
              prerelease: false
         | 
| 106 106 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 107 | 
             
                requirements:
         | 
| 108 | 
            -
                - - " | 
| 108 | 
            +
                - - ">="
         | 
| 109 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            -
                    version: 1. | 
| 110 | 
            +
                    version: '1.3'
         | 
| 111 111 | 
             
            description: Create API Clients From an DSL
         | 
| 112 112 | 
             
            email:
         | 
| 113 113 | 
             
            - me@sourcebender.com
         | 
| @@ -129,7 +129,9 @@ files: | |
| 129 129 | 
             
            - lib/diesel/data_model.rb
         | 
| 130 130 | 
             
            - lib/diesel/endpoint.rb
         | 
| 131 131 | 
             
            - lib/diesel/middleware/auth/api_key.rb
         | 
| 132 | 
            +
            - lib/diesel/middleware/auth/basic.rb
         | 
| 132 133 | 
             
            - lib/diesel/middleware/auth/oauth2.rb
         | 
| 134 | 
            +
            - lib/diesel/middleware/convert_json_body.rb
         | 
| 133 135 | 
             
            - lib/diesel/middleware/debug.rb
         | 
| 134 136 | 
             
            - lib/diesel/middleware/set_body_parameter.rb
         | 
| 135 137 | 
             
            - lib/diesel/middleware/set_header.rb
         | 
| @@ -152,18 +154,28 @@ files: | |
| 152 154 | 
             
            - lib/diesel/swagger/security.rb
         | 
| 153 155 | 
             
            - lib/diesel/swagger/security_definition.rb
         | 
| 154 156 | 
             
            - lib/diesel/swagger/specification.rb
         | 
| 157 | 
            +
            - lib/diesel/uri.rb
         | 
| 155 158 | 
             
            - lib/diesel/utils/inflections.rb
         | 
| 156 159 | 
             
            - lib/diesel/version.rb
         | 
| 157 160 | 
             
            - spec/diesel/api_builder_spec.rb
         | 
| 158 161 | 
             
            - spec/diesel/swagger/parser_spec.rb
         | 
| 159 162 | 
             
            - spec/diesel/swagger/specification_spec.rb
         | 
| 160 163 | 
             
            - spec/diesel_spec.rb
         | 
| 164 | 
            +
            - spec/files/github.json
         | 
| 165 | 
            +
            - spec/files/harvest.json
         | 
| 161 166 | 
             
            - spec/files/honeybadger.json
         | 
| 167 | 
            +
            - spec/files/mandrill.json
         | 
| 162 168 | 
             
            - spec/files/pivotal_tracker.json
         | 
| 163 169 | 
             
            - spec/files/slack.json
         | 
| 170 | 
            +
            - spec/files/uber.json
         | 
| 171 | 
            +
            - spec/fixtures/vcr_cassettes/github_checkAuthorization.yml
         | 
| 172 | 
            +
            - spec/fixtures/vcr_cassettes/github_getUser.yml
         | 
| 173 | 
            +
            - spec/fixtures/vcr_cassettes/harvest_invoiceList.yml
         | 
| 164 174 | 
             
            - spec/fixtures/vcr_cassettes/honeybadger.yml
         | 
| 175 | 
            +
            - spec/fixtures/vcr_cassettes/mandrill_userPing.yml
         | 
| 165 176 | 
             
            - spec/fixtures/vcr_cassettes/pivotal_tracker_create_story.yml
         | 
| 166 177 | 
             
            - spec/fixtures/vcr_cassettes/slack.yml
         | 
| 178 | 
            +
            - spec/fixtures/vcr_cassettes/uber_getProducts.yml
         | 
| 167 179 | 
             
            - spec/spec_helper.rb
         | 
| 168 180 | 
             
            homepage: http://github.com/cyu/diesel
         | 
| 169 181 | 
             
            licenses:
         | 
| @@ -194,10 +206,20 @@ test_files: | |
| 194 206 | 
             
            - spec/diesel/swagger/parser_spec.rb
         | 
| 195 207 | 
             
            - spec/diesel/swagger/specification_spec.rb
         | 
| 196 208 | 
             
            - spec/diesel_spec.rb
         | 
| 209 | 
            +
            - spec/files/github.json
         | 
| 210 | 
            +
            - spec/files/harvest.json
         | 
| 197 211 | 
             
            - spec/files/honeybadger.json
         | 
| 212 | 
            +
            - spec/files/mandrill.json
         | 
| 198 213 | 
             
            - spec/files/pivotal_tracker.json
         | 
| 199 214 | 
             
            - spec/files/slack.json
         | 
| 215 | 
            +
            - spec/files/uber.json
         | 
| 216 | 
            +
            - spec/fixtures/vcr_cassettes/github_checkAuthorization.yml
         | 
| 217 | 
            +
            - spec/fixtures/vcr_cassettes/github_getUser.yml
         | 
| 218 | 
            +
            - spec/fixtures/vcr_cassettes/harvest_invoiceList.yml
         | 
| 200 219 | 
             
            - spec/fixtures/vcr_cassettes/honeybadger.yml
         | 
| 220 | 
            +
            - spec/fixtures/vcr_cassettes/mandrill_userPing.yml
         | 
| 201 221 | 
             
            - spec/fixtures/vcr_cassettes/pivotal_tracker_create_story.yml
         | 
| 202 222 | 
             
            - spec/fixtures/vcr_cassettes/slack.yml
         | 
| 223 | 
            +
            - spec/fixtures/vcr_cassettes/uber_getProducts.yml
         | 
| 203 224 | 
             
            - spec/spec_helper.rb
         | 
| 225 | 
            +
            has_rdoc: 
         |