Skip to content

Commit

Permalink
fix 没有必填字段的时候报错
Browse files Browse the repository at this point in the history
  • Loading branch information
ez committed Mar 9, 2020
1 parent dff1a56 commit 28c7d54
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/generators/model/default/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
/**
* @OA\Schema(
* schema="<?= $className ?>",
<?php if (isset($oasSchemas['required'])): ?>
* required={<?= rtrim(ltrim(json_encode($oasSchemas['required']),'['),']') ?>},
<?php endif; ?>
<?php foreach ($oasSchemas['properties'] as $property): ?>
<?php if (in_array($property['property'],['created_at','created_by','updated_at','updated_by','deleted_at'])):
continue;
Expand Down

0 comments on commit 28c7d54

Please sign in to comment.