From ee0496af6590ee1a98671d1ae6170ea8b0e27a5d Mon Sep 17 00:00:00 2001 From: Bez Hermoso Date: Wed, 25 Jun 2014 14:23:19 -0700 Subject: [PATCH] Update swagger-support.md --- Formatter/SwaggerFormatter.php | 4 +++- Resources/doc/swagger-support.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Formatter/SwaggerFormatter.php b/Formatter/SwaggerFormatter.php index 65248eb..532249a 100644 --- a/Formatter/SwaggerFormatter.php +++ b/Formatter/SwaggerFormatter.php @@ -342,7 +342,9 @@ class SwaggerFormatter implements FormatterInterface switch ($prop['actualType']) { case DataTypes::ENUM: $type = 'string'; - $enum = array_keys(json_decode($prop['format'], true)); + if (isset($prop['format'])) { + $enum = array_keys(json_decode($prop['format'], true)); + } break; case DataTypes::MODEL: diff --git a/Resources/doc/swagger-support.md b/Resources/doc/swagger-support.md index f45d0dd..b2b50fe 100644 --- a/Resources/doc/swagger-support.md +++ b/Resources/doc/swagger-support.md @@ -83,7 +83,7 @@ The routes registered with the method above will read your `@ApiDoc` annotation php app/console api:swagger:dump --all app/Resources/swagger-docs ``` -The above command will dump JSON files under the `app/Resources/swagger-docs` directory (relative to your project root), and you can now process or server the files however you want. (If the destination defaults to the project root if not specified.) +The above command will dump JSON files under the `app/Resources/swagger-docs` directory (relative to your project root), and you can now process or server the files however you want. The destination defaults to the project root if not specified. ####Selective dumps