From fc9665621173f29af5856c75c5b5f565b649132f Mon Sep 17 00:00:00 2001 From: Tim Younger Date: Wed, 22 Feb 2017 12:48:38 -0700 Subject: [PATCH] skip Swagger model properties when input_filter fields are incorrectly defined. --- src/Service.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Service.php b/src/Service.php index 533f296..5d3ae37 100644 --- a/src/Service.php +++ b/src/Service.php @@ -6,6 +6,7 @@ namespace ZF\Apigility\Documentation\Swagger; +use ZF\Apigility\Documentation\Field; use ZF\Apigility\Documentation\Service as BaseService; class Service extends BaseService @@ -156,6 +157,9 @@ public function toArray() $requiredProperties = $properties = []; foreach ($fields as $field) { + if (!$field instanceof Field) { + continue; + } $properties[$field->getName()] = [ 'type' => method_exists($field, 'getFieldType') ? $field->getFieldType() : 'string', 'dataType' => method_exists($field, 'getFieldType') ? $field->getFieldType() : 'string',