Skip to content

Commit

Permalink
support for nullable media types
Browse files Browse the repository at this point in the history
  • Loading branch information
christopheg committed Jul 9, 2021
1 parent 5f40c54 commit f829dff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Skeleton/Application/Api/Media/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ class Type {
*/
public $format = null;

/**
* Nullable
*
* @access public
* @var boolean $nullable
*/
public $nullable = false;

/**
* Valuetype
* The object in the array or the classname in case of type=object
Expand Down Expand Up @@ -106,6 +114,9 @@ public function get_schema() {
if (isset($this->format)) {
$schema['format'] = $this->format;
}
if (isset($this->nullable) and $this->nullable !== false) {
$schema['nullable'] = $this->nullable;
}
}

if ($this->type == 'object') {
Expand Down

0 comments on commit f829dff

Please sign in to comment.