Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiri111enz authored and v8tenko committed Jan 30, 2024
1 parent 3f70a26 commit 5221ec0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/includer/traverse/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,14 @@ function prepareSampleElement(
}

const downCallstack = callstack.concat(value);

if (value.oneOf?.length) {
return prepareSampleElement(key, value.oneOf[0], isRequired(key, value), downCallstack);
}

const type = inferType(value);

const schema = findNonNullOneOfElement(value);

if (value.oneOf?.length) {
return prepareSampleElement(key, schema, isRequired(key, value), downCallstack);
}

switch (type) {
case 'object':
return prepareSampleObject(schema, downCallstack);
Expand Down

0 comments on commit 5221ec0

Please sign in to comment.