This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Wojciech Możejko
committed
Aug 30, 2016
1 parent
2cee3a2
commit 5e645d2
Showing
11 changed files
with
108 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<query-parameters> | ||
<div if={ queryParameters.length > 0 }> | ||
<div class="ui small header">Query Parameters</div> | ||
|
||
<table class="ui table"> | ||
<thead> | ||
<tr> | ||
<th width="160px">Name</th> | ||
<th width="100px">Type</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr each={ param in queryParameters }> | ||
<td>{ param.name() }</td> | ||
<td>{ param.type() }</td> | ||
<td>{getQueryParameterDescription(param) }</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<script> | ||
var _ = require('lodash') | ||
|
||
this.method = opts.method | ||
|
||
this.traits = _.map(this.method.parent().is(), (is) => { | ||
return is.trait() | ||
}) | ||
|
||
this.queryParameters = this.method.queryParameters() | ||
|
||
this.traits.forEach((trait) => { | ||
trait.queryParameters().forEach((queryParameter) => { | ||
this.queryParameters.push(queryParameter) | ||
}) | ||
}) | ||
|
||
this.getQueryParameterDescription = (queryParameter) => { | ||
var description = '' | ||
var details = [] | ||
|
||
if (queryParameter.description()) { | ||
description = queryParameter.description().value() + ' ' | ||
} | ||
|
||
if (queryParameter.kind() == 'StringTypeDeclaration' && queryParameter.enum().length) { | ||
details.push('enum [' + queryParameter.enum().join(', ') + ']') | ||
} | ||
|
||
if (queryParameter.default()) { | ||
details.push('default: ' + queryParameter.default()) | ||
} | ||
|
||
if (queryParameter.example()) { | ||
details.push('example: ' + queryParameter.example()) | ||
} | ||
|
||
if (details.length) { | ||
description = description + '(' + details.join(', ') + ')' | ||
} | ||
|
||
return description | ||
} | ||
</script> | ||
</query-parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,3 @@ | ||
<method-request> | ||
<div if={ queryParameters.length > 0 }> | ||
<div class="ui small header">Query Parameters</div> | ||
|
||
<table class="ui table"> | ||
<thead> | ||
<tr> | ||
<th width="160px">Name</th> | ||
<th width="100px">Type</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr each={ param in queryParameters }> | ||
<td>{ param.name() }</td> | ||
<td>{ param.type() }</td> | ||
<td>{ param.default() }</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<script> | ||
var _ = require('lodash') | ||
|
||
this.method = opts.method | ||
|
||
this.traits = _.map(this.method.parent().is(), (is) => { | ||
return is.trait() | ||
}) | ||
|
||
this.queryParameters = this.method.queryParameters() | ||
|
||
this.traits.forEach((trait) => { | ||
trait.queryParameters().forEach((queryParameter) => { | ||
this.queryParameters.push(queryParameter) | ||
}) | ||
}) | ||
</script> | ||
<query-parameters method={ opts.method } /> | ||
</method-request> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<resource-uri-parameters> | ||
<div class="ui small header">URI Parameters</div> | ||
|
||
<table class="ui table"> | ||
<thead> | ||
<tr> | ||
<th width="160px">Name</th> | ||
<th width="100px">Type</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr each={ param in opts.resource.uriParameters() }> | ||
<td>{ param.name() }</td> | ||
<td>{ param.type() }</td> | ||
<td>{ '' }</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</resource-uri-parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters