Skip to content

Commit

Permalink
Release 2.0.7
Browse files Browse the repository at this point in the history
 - Beter validation of type="file" #305
 - Augment Operations summary and description based on the comment. #293
 - Bugfixes #300
 - Add support for xml (and externalDocs and properties) inside a @swg\Items. #279
 - Nested properties are no longer injected into the Definition #297
 - Fixed nesting issue with verbose property notation #297
  • Loading branch information
bfanger committed May 27, 2016
1 parent 5d8afaf commit 632341c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Changelog

- Augment Operations summary and description based on the comment. #293
- Bugfixes #300

## 2.0.7

- Beter validation of type="file" #305
- Augment Operations summary and description based on the comment. #293
- Bugfixes #300
- Add support for xml (and externalDocs and properties) inside a @SWG\Items. #279
- Nested properties are no longer injected into the Definition #297
- Fixed nesting issue with verbose property notation #297
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.6
2.0.7
5 changes: 4 additions & 1 deletion src/Annotations/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function validate($parents = [], $skip = [])
$valid = parent::validate($parents, $skip);
if (empty($this->ref)) {
if ($this->in === 'body') {
if ($this->schema === null && $this->type !== 'file') {
if ($this->schema === null) {
Logger::notice('Field "schema" is required when ' . $this->identity() . ' is in "' . $this->in . '" in ' . $this->_context);
$valid = false;
}
Expand All @@ -228,6 +228,9 @@ public function validate($parents = [], $skip = [])
} elseif (in_array($this->type, $validTypes) === false) {
$valid = false;
Logger::notice($this->identity() . '->type must be "' . implode('", "', $validTypes) . '" when ' . $this->_identity([]) . '->in != "body" in ' . $this->_context);
} elseif ($this->type === 'file' && $this->in !== 'formData') {
Logger::notice($this->identity() . '->in must be "formData" when ' . $this->_identity([]) . '->type == "file" in ' . $this->_context);
$valid = false;
}
}
}
Expand Down

0 comments on commit 632341c

Please sign in to comment.