Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tables to represent markdown response fields #318

Merged
merged 1 commit into from
Jan 25, 2017
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
9 changes: 4 additions & 5 deletions features/markdown_documentation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Feature: Generate Markdown documentation from test examples
* [Updating an order](orders/updating_an_order.markdown)
"""

Scenario: Example 'Getting al ist of orders' file should look like we expect
Scenario: Example 'Getting a list of orders' file should look like we expect
Then the file "doc/api/orders/getting_a_list_of_orders.markdown" should contain exactly:
"""
# Orders API
Expand All @@ -175,8 +175,9 @@ Feature: Generate Markdown documentation from test examples

### Response Fields

Name : page
Description : Current page
| Name | Description | Scope |
|------|-------------|-------|
| page | Current page | |

### Request

Expand Down Expand Up @@ -276,5 +277,3 @@ Feature: Generate Markdown documentation from test examples

Scenario: Example 'Getting welcome message' file should be created
Then a file named "doc/api/help/getting_welcome_message.markdown" should exist


7 changes: 4 additions & 3 deletions templates/rspec_api_documentation/markdown_example.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
{{# has_response_fields? }}

### Response Fields
{{# response_fields }}

Name : {{ name }}
Description : {{ description }}
| Name | Description | Scope |
|------|-------------|-------|
{{# response_fields }}
| {{ name }} | {{ description }} | {{ scope }} |
{{/ response_fields }}

{{/ has_response_fields? }}
Expand Down