Skip to content

Commit

Permalink
0.2.2 Bugfix: Template not show @apiSuccessExample @apiErrorExample.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Jun 4, 2013
1 parent 3f00fea commit 9c632cf
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# apiDoc Changelog

#### 0.2.2
Bugfix: Template not show @apiSuccessExample @apiErrorExample.

#### 0.2.1
Bugfix: executable line delimiters.

Expand Down
15 changes: 14 additions & 1 deletion example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,27 @@
*
* @apiParam {String} id The Users-ID.
*
* @apiExample CURL example:
* curl -i -X POST http://localhost:3001/example
* -H 'Content-Type: application/json' \
* -d '{ "id": "4711" }'
*
* @apiSuccess {String} id The Users-ID.
* @apiSuccess {Date} registered Registration Date.
* @apiSuccess {Date} name Fullname of the User.
*
* @apiSuccessExample Success-Response (example):
* HTTP/1.1 200 OK
* {
* "id": "4711"
* "registered": "31.01.2013"
* "name": "John Doe"
* }
*
* @apiError NoAccessRight Only authenticated Admins can access the data.
* @apiError UserNotFound The <code>id</code> of the User was not found.
*
* @apiErrorExample Response (example):
* @apiErrorExample Error-Response (example):
* HTTP/1.1 401 Not Authenticated
* {
* "error": "NoAccessRight"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apidoc",
"version": "0.2.1",
"version": "0.2.2",
"description": "RESTful web API Documentation Generator",
"author": "Peter Rottmann <[email protected]>",
"license": "MIT",
Expand Down
40 changes: 19 additions & 21 deletions template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,10 @@ <h2>{{__ @key}}</h2>
{{/each}}
</tbody>
</table>

{{#each params.examples}}
<strong>{{title}}</strong>
<pre class="prettyprint language-json" data-type="json"><code>{{{content}}}</code></pre>
{{/each}}
{{/each}}
{{#each params.examples}}
<strong>{{title}}</strong>
<pre class="prettyprint language-json" data-type="json"><code>{{{content}}}</code></pre>
{{/each}}
{{/if}}
</script>
Expand Down Expand Up @@ -347,26 +346,25 @@ <h2><del>{{__ compare.key}}</del></h2>
{{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../../_hasType}}
</table>
{{/if}}
{{/each_compare_keys}}
{{#each_compare_title source.examples compare.examples}}

{{#each_compare_title source.examples compare.examples}}

{{#if typeSame}}
<strong>{{{showDiff source.title compare.title}}}</strong>
<pre class="prettyprint language-json" data-type="json"><code>{{{showDiff source.content compare.content}}}</code></pre>
{{/if}}
{{#if typeSame}}
<strong>{{{showDiff source.title compare.title}}}</strong>
<pre class="prettyprint language-json" data-type="json"><code>{{{showDiff source.content compare.content}}}</code></pre>
{{/if}}

{{#if typeIns}}
<strong><ins>{{{source.title}}}</ins></strong>
<pre class="ins prettyprint language-json" data-type="json"><code>{{{source.content}}}</code></pre>
{{/if}}
{{#if typeIns}}
<strong><ins>{{{source.title}}}</ins></strong>
<pre class="ins prettyprint language-json" data-type="json"><code>{{{source.content}}}</code></pre>
{{/if}}

{{#if typeDel}}
<strong><del>{{{compare.title}}}</del></strong>
<pre class="del prettyprint language-json" data-type="json"><code>{{{compare.content}}}</code></pre>
{{/if}}
{{#if typeDel}}
<strong><del>{{{compare.title}}}</del></strong>
<pre class="del prettyprint language-json" data-type="json"><code>{{{compare.content}}}</code></pre>
{{/if}}

{{/each_compare_title}}
{{/each_compare_keys}}
{{/each_compare_title}}
{{/if}}
</script>

Expand Down
9 changes: 4 additions & 5 deletions template_basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,10 @@ <h2>{{__ @key}}</h2>
{{/each}}
</tbody>
</table>

{{#each params.examples}}
<strong>{{title}}</strong>
<pre class="prettyprint language-json" data-type="json"><code>{{{content}}}</code></pre>
{{/each}}
{{/each}}
{{#each params.examples}}
<strong>{{title}}</strong>
<pre class="prettyprint language-json" data-type="json"><code>{{{content}}}</code></pre>
{{/each}}
{{/if}}
</script>
Expand Down

0 comments on commit 9c632cf

Please sign in to comment.