Skip to content

Commit

Permalink
if no examples, return any type in "generateAndMergeSchemaObjects"
Browse files Browse the repository at this point in the history
  • Loading branch information
dphuang2 committed Mar 29, 2024
1 parent c1bc103 commit 2d8d20b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ export function generateAndMergeSchemaObjects({
}: {
examples: Json[]
version: OpenApiVersion
}) {
}): SchemaOrReference {
const exampleSchemaObjects: SchemaOrReference[] = examples.map((example) =>
generateSchemaObjectFromJson({
json: example,
version,
})
)
if (exampleSchemaObjects.length === 0) {
return {}
}
const mergedSchemaObject = exampleSchemaObjects.reduce((a, b) =>
mergeSchemaObject({ a, b })
)
Expand Down

0 comments on commit 2d8d20b

Please sign in to comment.