Skip to content

Commit

Permalink
add early example return for tree (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fischer authored Sep 22, 2024
1 parent 4079455 commit 1e9e6dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generator/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ function extractInfo(obj, mode = 'example') {
if (obj.items.hasOwnProperty('properties')) {
return [extractInfo(obj.items.properties, mode)];
} else {
if (mode === 'example' && obj.hasOwnProperty('example')) {
return obj.example;
}
return [extractInfo(obj.items, mode)];
}
}
Expand Down

0 comments on commit 1e9e6dc

Please sign in to comment.