Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Mar 23, 2015
1 parent fe5ee04 commit f8d3106
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 38 deletions.
2 changes: 1 addition & 1 deletion API Blueprint Specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ This section **should** include at least one nested [Action section](#def-action

- [`0-1` URI parameters section](#def-uriparameters-section)

URI parameters defined in the scope of a Resource section apply to _any and all_ nested Action sections.
URI parameters defined in the scope of a Resource section apply to _any and all_ nested Action sections except when an [URI template][uritemplate] has been defined for the Action.

- [`0-1` Attributes section][]

Expand Down
63 changes: 26 additions & 37 deletions examples/12. Advanced Action.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,20 @@
FORMAT: 1A

# Advanced Action API
An action in a resource in the API Blueprint can be considered as a state transition. This API example demonstrates that a resource can contain a state transition to another resource. This allows us to show that the resource `Task` can afford an action that is not limited to the resource `Task`.
A resource action is – in fact – a state transition. This API example demonstrates an action - state transition - to another resource.

## API Blueprint
+ [Previous: Resource Model](11.%20Resource%20Model.md)
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/11.%20Advanced%20Action.md)

# Task [/tasks/{id}]

+ Parameters
+ id (string)

## Retrieve Task [GET]

+ Response 200 (application/json)

{
"id": 123,
"name": "Go to gym",
"done": false,
"type": "task"
}

## Update Task [PATCH]
This is a state transition within the same resource

+ Request (application/json)

{
"name": "Exercise in gym"
}

+ Response 200 (application/json)

{
"id": 123,
"name": "Exercise in gym",
"done": false,
"type": "task"
}

## List All Tasks [GET /tasks{?status,priority}]
This is a state transition to another resource
# Tasks [/tasks/tasks{?status,priority}]

+ Parameters
+ status (string)
+ priority (number)

## List All Tasks [GET]

+ Response 200 (application/json)

[
Expand All @@ -64,3 +31,25 @@ This is a state transition to another resource
"type": "task"
}
]

## Retrieve Task [GET /task/{id}]
This is a state transition to another resource

+ Parameters
+ id (string)

+ Response 200 (application/json)

{
"id": 123,
"name": "Go to gym",
"done": false,
"type": "task"
}

## Delete Task [DELETE /task/{id}]

+ Parameters
+ id (string)

+ Response 204

3 comments on commit f8d3106

@zanona
Copy link

@zanona zanona commented on f8d3106 Mar 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/12. Advanced Action.md doesn't seem to be valid when used on apiary.io?

@zdne
Copy link
Contributor

@zdne zdne commented on f8d3106 Mar 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zanona sorry for the confusion – we are rolling out the new version of API Blueprint 1A8 – but at the moment Apiary still runs on the older version 1A7 – see https://github.com/apiaryio/api-blueprint#format-support. We hope to update Apiary to the latest one during the course of this week

@zanona
Copy link

@zanona zanona commented on f8d3106 Mar 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdne that's great. looking forward to use it ;) all the best

Please sign in to comment.