-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #12: parse parenthesis in object properties.
- Loading branch information
Showing
6 changed files
with
126 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/** | ||
* Tests issue 12; @rest\response 200 object(modifications:array(ModificationHistory),users:array(User)) | ||
* https://github.com/vanderlee/PHPSwaggerGen/issues/12 | ||
*/ | ||
class Issue0012Test extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public function testIssue() | ||
{ | ||
$object = new \SwaggerGen\SwaggerGen(); | ||
$array = $object->getSwagger(array(' | ||
api Test | ||
endpoint /test | ||
method GET something | ||
response 200 object(modifications:array(ModificationHistory),users:array(User)) | ||
')); | ||
|
||
$this->assertSame('{"swagger":2,"info":{"title":"undefined","version":0}' | ||
. ',"paths":{"\/test":{"get":{"tags":["Test"],"summary":"something"' | ||
. ',"responses":{"200":{"description":"OK","schema":{"type":"object","required":["modifications","users"]' | ||
. ',"properties":{"modifications":{"type":"array","items":{"$ref":"#\/definitions\/ModificationHistory"}}' | ||
. ',"users":{"type":"array","items":{"$ref":"#\/definitions\/User"}}}}}}}}}' | ||
. ',"tags":[{"name":"Test"}]}', json_encode($array, JSON_NUMERIC_CHECK)); | ||
} | ||
|
||
} |