Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.
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
12 changes: 6 additions & 6 deletions resources/examples/Showtimes/blueprints/1.0/api.apib
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FORMAT: 1A
# Mill unit test API, Showtimes
This is the API Blueprint file for Mill unit test API, Showtimes.

It was automatically generated by [Mill](https://github.com/vimeo/mill) on 2017-04-20 11:43:54.
It was automatically generated by [Mill](https://github.com/vimeo/mill) on 2017-04-20 13:56:37.

# Group Movies
## Movies [/movies/{id}]
Information on a specific movie.

### Get a single movie. [GET]
+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 200 (application/json)
+ Attributes (Movie)
+ Response 304 (application/json)
Expand All @@ -22,7 +22,7 @@ Information on a specific movie.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down Expand Up @@ -84,7 +84,7 @@ Information on a specific movie theater.

### Get a single movie theater [GET]
+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 200 (application/json)
+ Attributes (Theater)
+ Response 304 (application/json)
Expand All @@ -95,7 +95,7 @@ Information on a specific movie theater.
This action requires a bearer token with `create` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Request
+ Headers

Expand All @@ -116,7 +116,7 @@ This action requires a bearer token with `create` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Information on a specific movie.

### Get a single movie. [GET]
+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 200 (application/json)
+ Attributes (Movie)
+ Response 304 (application/json)
Expand All @@ -15,7 +15,7 @@ Information on a specific movie.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Information on a specific movie theater.

### Get a single movie theater [GET]
+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 200 (application/json)
+ Attributes (Theater)
+ Response 304 (application/json)
Expand All @@ -15,7 +15,7 @@ Information on a specific movie theater.
This action requires a bearer token with `create` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Request
+ Headers

Expand All @@ -36,7 +36,7 @@ This action requires a bearer token with `create` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
14 changes: 7 additions & 7 deletions resources/examples/Showtimes/blueprints/1.1.1/api.apib
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FORMAT: 1A
# Mill unit test API, Showtimes
This is the API Blueprint file for Mill unit test API, Showtimes.

It was automatically generated by [Mill](https://github.com/vimeo/mill) on 2017-04-20 11:43:54.
It was automatically generated by [Mill](https://github.com/vimeo/mill) on 2017-04-20 13:56:37.

# Group Movies
## Movies [/movies/{id}]
Information on a specific movie.

### Get a single movie. [GET]
+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 200 (application/json)
+ Attributes (Movie)
+ Response 304 (application/json)
Expand All @@ -22,7 +22,7 @@ Information on a specific movie.
This action requires a bearer token with `edit` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Request
+ Headers

Expand Down Expand Up @@ -63,7 +63,7 @@ This action requires a bearer token with `edit` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down Expand Up @@ -127,7 +127,7 @@ Information on a specific movie theater.

### Get a single movie theater [GET]
+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 200 (application/json)
+ Attributes (Theater)
+ Response 304 (application/json)
Expand All @@ -138,7 +138,7 @@ Information on a specific movie theater.
This action requires a bearer token with `create` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Request
+ Headers

Expand All @@ -159,7 +159,7 @@ This action requires a bearer token with `create` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Information on a specific movie.

### Get a single movie. [GET]
+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 200 (application/json)
+ Attributes (Movie)
+ Response 304 (application/json)
Expand All @@ -15,7 +15,7 @@ Information on a specific movie.
This action requires a bearer token with `edit` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Request
+ Headers

Expand Down Expand Up @@ -56,7 +56,7 @@ This action requires a bearer token with `edit` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Information on a specific movie theater.

### Get a single movie theater [GET]
+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 200 (application/json)
+ Attributes (Theater)
+ Response 304 (application/json)
Expand All @@ -15,7 +15,7 @@ Information on a specific movie theater.
This action requires a bearer token with `create` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Request
+ Headers

Expand All @@ -36,7 +36,7 @@ This action requires a bearer token with `create` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
14 changes: 7 additions & 7 deletions resources/examples/Showtimes/blueprints/1.1/api.apib
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FORMAT: 1A
# Mill unit test API, Showtimes
This is the API Blueprint file for Mill unit test API, Showtimes.

It was automatically generated by [Mill](https://github.com/vimeo/mill) on 2017-04-20 11:43:54.
It was automatically generated by [Mill](https://github.com/vimeo/mill) on 2017-04-20 13:56:37.

# Group Movies
## Movies [/movies/{id}]
Information on a specific movie.

### Get a single movie. [GET]
+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 200 (application/json)
+ Attributes (Movie)
+ Response 304 (application/json)
Expand All @@ -22,7 +22,7 @@ Information on a specific movie.
This action requires a bearer token with `edit` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Request
+ Headers

Expand Down Expand Up @@ -62,7 +62,7 @@ This action requires a bearer token with `edit` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down Expand Up @@ -126,7 +126,7 @@ Information on a specific movie theater.

### Get a single movie theater [GET]
+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 200 (application/json)
+ Attributes (Theater)
+ Response 304 (application/json)
Expand All @@ -137,7 +137,7 @@ Information on a specific movie theater.
This action requires a bearer token with `create` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Request
+ Headers

Expand All @@ -158,7 +158,7 @@ This action requires a bearer token with `create` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Information on a specific movie.

### Get a single movie. [GET]
+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 200 (application/json)
+ Attributes (Movie)
+ Response 304 (application/json)
Expand All @@ -15,7 +15,7 @@ Information on a specific movie.
This action requires a bearer token with `edit` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Request
+ Headers

Expand Down Expand Up @@ -55,7 +55,7 @@ This action requires a bearer token with `edit` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Movie ID
- `id` (number, required) - Movie ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Information on a specific movie theater.

### Get a single movie theater [GET]
+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 200 (application/json)
+ Attributes (Theater)
+ Response 304 (application/json)
Expand All @@ -15,7 +15,7 @@ Information on a specific movie theater.
This action requires a bearer token with `create` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Request
+ Headers

Expand All @@ -36,7 +36,7 @@ This action requires a bearer token with `create` scope.
This action requires a bearer token with `delete` scope.

+ Parameters
+ `id` (integer, required) - Theater ID
- `id` (number, required) - Theater ID
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes (Error)
Expand Down
19 changes: 17 additions & 2 deletions src/Generator/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,30 @@ protected function processParameters(Action\Documentation $action)
$field = str_replace($from, $to, $field);
}

$values = $segment->getValues();
$type = $this->convertTypeToCompatibleType($segment->getType());

$blueprint .= $this->tab();
$blueprint .= sprintf(
'+ `%s` (%s, required) - %s',
'- `%s` (%s, required) - %s',
$field,
$segment->getType(),
(!empty($values)) ? 'enum[' . $type . ']' : $type,
$segment->getDescription()
);

$blueprint .= $this->line();

if (!empty($values)) {
$blueprint .= $this->tab(2);
$blueprint .= '+ Members';
$blueprint .= $this->line();

foreach ($values as $value) {
$blueprint .= $this->tab(3);
$blueprint .= '+ `' . $value . '`';
$blueprint .= $this->line();
}
}
}

return $blueprint;
Expand Down