Permalink
Browse files

Updated example: request/response fields include types

  • Loading branch information...
1 parent 3af2bfb commit d5f32e76e5ee7b60ccdd8a564d19dcdc8f1b417c @ur5us ur5us committed Nov 18, 2010
Showing with 40 additions and 54 deletions.
  1. +18 −32 README.markdown
  2. +22 −22 example/SampleController.rb
View
@@ -54,20 +54,6 @@ The rationale here is that you are documenting external services (as represented
# @argument ["@assigned"|"@complete"|"!@complete"] search Return samples that are assigned, complete, or
# uncomplete.
#
- # @example_request
- # <samples type="array">
- # <sample>
- # <id>961</id>
- # <name>My Sample</name>
- # <state>complete</state>
- # <last_unassigned_user_id type="integer"></last_unassigned_user_id>
- # <resource_id type="integer">127</resource_id>
- # <notes></notes>
- # <updated_at type="datetime">2010-03-09T20:43:29Z</updated_at>
- # <created_at type="datetime">2010-03-09T20:43:16Z</created_at>
- # </sample>
- # <samples>
- #
# @example_response
# <samples type="array">
# <sample>
@@ -82,12 +68,12 @@ The rationale here is that you are documenting external services (as represented
# </sample>
# <samples>
#
- # @response_field id A unique ID identifying the Sample
- # @response_field name The name of the sample
- # @response_field state The current status of the Sample. Can be complete, uncomplete, etc.
- # @response_field notes Any notes given for the sample
- # @response_field updated_at The Date/Time (in ISO8601) that the Sample was last updated
- # @response_field created_at The Date/Time (in ISO8601) that the Sample was created
+ # @response_field [Integer] id A unique ID identifying the Sample
+ # @response_field [String] name The name of the sample
+ # @response_field [String] state The current status of the Sample. Can be complete, uncomplete, etc.
+ # @response_field [String] notes Any notes given for the sample
+ # @response_field [DateTime] updated_at The Date/Time (in ISO8601) that the Sample was last updated
+ # @response_field [DateTime] created_at The Date/Time (in ISO8601) that the Sample was created
#
def index
end
@@ -116,12 +102,12 @@ The rationale here is that you are documenting external services (as represented
# <created_at type="datetime">2010-03-09T20:43:16Z</created_at>
# </sample>
#
- # @request_field id A unique ID identifying the Sample
- # @request_field name The name of the sample
- # @request_field state The current status of the Sample. Can be complete, uncomplete, etc.
- # @request_field note_attributes Any notes given for the sample that will be created
- # @request_field updated_at The Date/Time (in ISO8601) that the Sample was last updated
- # @request_field created_at The Date/Time (in ISO8601) that the Sample was created
+ # @request_field [Integer] id A unique ID identifying the Sample
+ # @request_field [String] name The name of the sample
+ # @request_field [String] state The current status of the Sample. Can be complete, uncomplete, etc.
+ # @request_field [String] note_attributes Any notes given for the sample that will be created
+ # @request_field [DateTime] updated_at The Date/Time (in ISO8601) that the Sample was last updated
+ # @request_field [DateTime] created_at The Date/Time (in ISO8601) that the Sample was created
#
# @example_response
# <sample>
@@ -139,12 +125,12 @@ The rationale here is that you are documenting external services (as represented
# <created_at type="datetime">2010-03-09T20:43:16Z</created_at>
# </sample>
#
- # @response_field id A unique ID identifying the Sample
- # @response_field name The name of the sample
- # @response_field state The current status of the Sample. Can be complete, uncomplete, etc.
- # @response_field notes Any notes given for the sample
- # @response_field updated_at The Date/Time (in ISO8601) that the Sample was last updated
- # @response_field created_at The Date/Time (in ISO8601) that the Sample was created
+ # @response_field [Integer] id A unique ID identifying the Sample
+ # @response_field [String] name The name of the sample
+ # @response_field [String] state The current status of the Sample. Can be complete, uncomplete, etc.
+ # @response_field [String] notes Any notes given for the sample
+ # @response_field [DateTime] updated_at The Date/Time (in ISO8601) that the Sample was last updated
+ # @response_field [DateTime] created_at The Date/Time (in ISO8601) that the Sample was created
#
def create
end
@@ -11,7 +11,7 @@ class SampleController
# @url [GET] /samples/index.[format]?[arguments]
# @url [GET] /samples.[format]?[arguments]
#
- # @argument [String] format Only "xml" is support at this time.
+ # @argument [String] format Only "xml" is supported at this time.
# @argument [String] name The name of the sample
# @argument [String] reource The resource that sample belongs to
# @argument ["@assigned"|"@complete"|"!@complete"] search Return jobs that are assigned, complete, or
@@ -28,15 +28,15 @@ class SampleController
# <notes></notes>
# <updated_at type="datetime">2010-03-09T20:43:29Z</updated_at>
# <created_at type="datetime">2010-03-09T20:43:16Z</created_at>
- # </interval>
- # <intervals>
+ # </sample>
+ # <samples>
#
- # @response_field id A unique ID identifying the Sample
- # @response_field name The name of the sample
- # @response_field state The current status of the Sample. Can be complete, uncomplete, etc.
- # @response_field notes Any notes given for the sample
- # @response_field updated_at The Date/Time (in ISO8601) that the Sample was last updated
- # @response_field created_at The Date/Time (in ISO8601) that the Sample was created
+ # @response_field [Integer] id A unique ID identifying the Sample
+ # @response_field [String] name The name of the sample
+ # @response_field [String] state The current status of the Sample. Can be complete, uncomplete, etc.
+ # @response_field [String] notes Any notes given for the sample
+ # @response_field [DateTime] updated_at The Date/Time (in ISO8601) that the Sample was last updated
+ # @response_field [DateTime] created_at The Date/Time (in ISO8601) that the Sample was created
#
def index
end
@@ -52,7 +52,7 @@ def show
#
# @url [POST] /samples.[format]?[arguments]
#
- # @argument [String] format Only "xml" is support at this time.
+ # @argument [String] format Only "xml" is supported at this time.
#
# @example_request
# <sample>
@@ -71,12 +71,12 @@ def show
# <created_at type="datetime">2010-03-09T20:43:16Z</created_at>
# </sample>
#
- # @request_field id A unique ID identifying the Sample
- # @request_field name The name of the sample
- # @request_field state The current status of the Sample. Can be complete, uncomplete, etc.
- # @request_field note_attributes Any notes given for the sample that will be created
- # @request_field updated_at The Date/Time (in ISO8601) that the Sample was last updated
- # @request_field created_at The Date/Time (in ISO8601) that the Sample was created
+ # @request_field [Integer] id A unique ID identifying the Sample
+ # @request_field [String] name The name of the sample
+ # @request_field [String] state The current status of the Sample. Can be complete, uncomplete, etc.
+ # @request_field [String] note_attributes Any notes given for the sample that will be created
+ # @request_field [DateTime] updated_at The Date/Time (in ISO8601) that the Sample was last updated
+ # @request_field [DateTime] created_at The Date/Time (in ISO8601) that the Sample was created
#
# @example_response
# <sample>
@@ -94,12 +94,12 @@ def show
# <created_at type="datetime">2010-03-09T20:43:16Z</created_at>
# </sample>
#
- # @response_field id A unique ID identifying the Sample
- # @response_field name The name of the sample
- # @response_field state The current status of the Sample. Can be complete, uncomplete, etc.
- # @response_field notes Any notes given for the sample
- # @response_field updated_at The Date/Time (in ISO8601) that the Sample was last updated
- # @response_field created_at The Date/Time (in ISO8601) that the Sample was created
+ # @response_field [Integer] id A unique ID identifying the Sample
+ # @response_field [String] name The name of the sample
+ # @response_field [String] state The current status of the Sample. Can be complete, uncomplete, etc.
+ # @response_field [String] notes Any notes given for the sample
+ # @response_field [DateTime] updated_at The Date/Time (in ISO8601) that the Sample was last updated
+ # @response_field [DateTime] created_at The Date/Time (in ISO8601) that the Sample was created
#
def create
end

0 comments on commit d5f32e7

Please sign in to comment.