Skip to content

Commit fd44759

Browse files
committed
Use enum for ecample data when available
1 parent db70803 commit fd44759

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Gatherer/Property.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public static function gather(
2323
$exampleData = $property->examples[0];
2424
} else if ($property->example !== null) {
2525
$exampleData = $property->example;
26+
} else if (count($property->enum ?? []) > 0) {
27+
$exampleData = $property->enum[0];
2628
}
2729

2830
$propertyName = str_replace([

0 commit comments

Comments
 (0)