Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This is the Wordnik Swagger javascript client for use with [swagger](http://swagger.wordnik.com) enabled APIs.
It's written in CoffeeScript and tested with Jasmine, and is the fastest way to enable a javascript client to communicate with a swagger-enabled server.

Find out more about the swagger project at [swagger.wordnik.com](http://swagger.wordnik.com),
Find out more about the swagger project at [swagger.wordnik.com](http://swagger.wordnik.com),
and follow us on Twitter at [@swagger_doc](https://twitter.com/#!/swagger_doc).

## READ MORE about swagger!
Expand Down Expand Up @@ -61,13 +61,13 @@ That's it! You'll get a JSON response with the default callback handler:
Need to pass an API key? Configure one as a querystring:

```js
client.authorizations.add("apiKey", new swagger.ApiKeyAuthorization("api_key","special-key","query"));
client.authorizations.add("apiKey", new client.ApiKeyAuthorization("api_key","special-key","query"));
```

...or with a header:

```js
client.authorizations.add("apiKey", new swagger.ApiKeyAuthorization("api_key","special-key","header"));
client.authorizations.add("apiKey", new client.ApiKeyAuthorization("api_key","special-key","header"));
```

### Calling an API with swagger + the browser!
Expand Down Expand Up @@ -129,11 +129,11 @@ The HTTP requests themselves are handled by the excellent [shred](https://github
Development
-----------

Please [fork the code](https://github.com/wordnik/swagger-js) and help us improve
Please [fork the code](https://github.com/wordnik/swagger-js) and help us improve
swagger.js. Send us a pull request and **we'll mail you a wordnik T-shirt!**

Swagger.js is written in CoffeeScript, so you'll need Node.js and the
CoffeeScript compiler. For more detailed installation instructions, see
Swagger.js is written in CoffeeScript, so you'll need Node.js and the
CoffeeScript compiler. For more detailed installation instructions, see
[coffeescript.org/#installation](http://coffeescript.org/#installation).

```bash
Expand Down Expand Up @@ -161,7 +161,7 @@ Copyright 2011-2013 Wordnik, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
You may obtain a copy of the License at
[apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software
Expand Down
3 changes: 2 additions & 1 deletion lib/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ ApiKeyAuthorization.prototype.apply = function(obj, authorizations) {
if (obj.url.indexOf('?') > 0)
obj.url = obj.url + "&" + this.name + "=" + this.value;
else
obj.url = obj.url + "?" + this.name + "=" + this.value;
obj.url = obj.url + "?" + this.name + "=" + this.value;
return true;
} else if (this.type === "header") {
obj.headers[this.name] = this.value;
Expand Down Expand Up @@ -1304,6 +1304,7 @@ var e = (typeof window !== 'undefined' ? window : exports);
e.SwaggerHttp = SwaggerHttp;
e.SwaggerRequest = SwaggerRequest;
e.authorizations = new SwaggerAuthorizations();
e.ApiKeyAuthorization = ApiKeyAuthorization;
e.JQueryHttpClient = JQueryHttpClient;
e.ShredHttpClient = ShredHttpClient;
e.SwaggerOperation = SwaggerOperation;
Expand Down