Skip to content

Commit

Permalink
* feat: support nullable field of combine schemas (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: hinaiji <[email protected]>
  • Loading branch information
keita1714 and hinaiji-at-exp-t authored Oct 26, 2021
1 parent 1f9e7ab commit a0f63f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/internal/OpenApiTools/toTypeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ export const convert: Convert = (
}

if (Guard.isOneOfSchema(schema)) {
return generateMultiTypeNode(entryPoint, currentPoint, factory, schema.oneOf, context, convert, converterContext, "oneOf");
return nullable(factory, generateMultiTypeNode(entryPoint, currentPoint, factory, schema.oneOf, context, convert, converterContext, "oneOf"), !!schema.nullable);
}
if (Guard.isAllOfSchema(schema)) {
return generateMultiTypeNode(entryPoint, currentPoint, factory, schema.allOf, context, convert, converterContext, "allOf");
return nullable(factory, generateMultiTypeNode(entryPoint, currentPoint, factory, schema.allOf, context, convert, converterContext, "allOf"), !!schema.nullable);
}
if (Guard.isAnyOfSchema(schema)) {
return generateMultiTypeNode(entryPoint, currentPoint, factory, schema.anyOf, context, convert, converterContext, "anyOf");
return nullable(factory, generateMultiTypeNode(entryPoint, currentPoint, factory, schema.anyOf, context, convert, converterContext, "anyOf"), !!schema.nullable);
}

if (Guard.isHasNoMembersObject(schema)) {
Expand Down

0 comments on commit a0f63f3

Please sign in to comment.