Skip to content

Commit

Permalink
Fixed isCollectionType missing, added forgotten swagger.js informatio…
Browse files Browse the repository at this point in the history
…n in README. This closes lbovet#2.
  • Loading branch information
lbovet committed Jan 12, 2014
1 parent c5f86f8 commit 43d87ec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ In Swagger UI's `index.html`, include the [Swagger integration script after othe
<script src='/path-to-docson/docson-swagger.js' type='text/javascript'></script>
```

Also, you will need a patched version of [Swagger Client](https://github.com/lbovet/swagger-js/blob/models-exposed/lib/swagger.js) so that the raw json-schema model is visible from Docson. Either replace the `swagger.js` file in your Swagger UI disctribution or take it directly from github by replacing

```
<script src='/lib/swagger.js' type='text/javascript'></script>
```

with

```
<script src='https://raw2.github.com/lbovet/swagger-js/models-exposed/lib/swagger.js' type='text/javascript'></script>
```

For a better layout of parameter models, you may [want to change the width of some elements](https://github.com/lbovet/swagger-ui/blob/3f37722b03db6c48cc2a8460df26dda5f4d6f8e4/src/main/html/index.html#L20-L27):

```
Expand Down
6 changes: 5 additions & 1 deletion docson-swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ function createDoc(definitions, type) {

SwaggerOperation.prototype.getSignature = function(type, models) {
var collectionType, isPrimitive;
collectionType = this.isCollectionType(type);
if(this.isCollectionType) {
collectionType = this.isCollectionType(type);
} else {
collectionType = this.isListType(type);
}
isPrimitive = ((collectionType != null) && models[collectionType]) || (models[type] != null) ? false : true;
if (isPrimitive) {
return type;
Expand Down

0 comments on commit 43d87ec

Please sign in to comment.