Skip to content

Commit

Permalink
fix(schema): schema can be null in mapNullableType
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 authored and Romakita committed Jan 16, 2022
1 parent f204ecf commit 4bee99f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/specs/schema/src/utils/mapNullableType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function hasNullable(obj: any) {
return obj.oneOf.find((o: any) => o.type === "null");
}

export function mapNullableType(obj: any, schema: JsonSchema, options: JsonSchemaOptions) {
if (!schema.isNullable) {
export function mapNullableType(obj: any, schema: JsonSchema | null, options: JsonSchemaOptions) {
if (!schema?.isNullable) {
return obj;
}
let types: string[] = [].concat(obj.type).filter(Boolean);
Expand Down

0 comments on commit 4bee99f

Please sign in to comment.