diff --git a/packages/cli/openapi-parser/src/schema/convertSchemas.ts b/packages/cli/openapi-parser/src/schema/convertSchemas.ts index 9bc10a5cdaa..79bba16845e 100644 --- a/packages/cli/openapi-parser/src/schema/convertSchemas.ts +++ b/packages/cli/openapi-parser/src/schema/convertSchemas.ts @@ -13,6 +13,7 @@ import { OpenAPIExtension } from "../openapi/v3/extensions/extensions"; import { FernOpenAPIExtension } from "../openapi/v3/extensions/fernExtensions"; import { getFernEnum } from "../openapi/v3/extensions/getFernEnum"; import { getFernTypeExtension } from "../openapi/v3/extensions/getFernTypeExtension"; +import { getValueIfBoolean } from "../utils/getValue"; import { convertAdditionalProperties, wrapMap } from "./convertAdditionalProperties"; import { convertArray } from "./convertArray"; import { convertDiscriminatedOneOf, convertDiscriminatedOneOfWithVariants } from "./convertDiscriminatedOneOf"; @@ -296,8 +297,8 @@ export function convertSchemaObject( _default: schema.default, minimum: schema.minimum, maximum: schema.maximum, - exclusiveMinimum: schema.exclusiveMinimum, - exclusiveMaximum: schema.exclusiveMaximum, + exclusiveMinimum: getValueIfBoolean(schema.exclusiveMinimum), + exclusiveMaximum: getValueIfBoolean(schema.exclusiveMaximum), multipleOf: schema.multipleOf, description, wrapAsNullable, diff --git a/packages/cli/openapi-parser/src/utils/getValue.ts b/packages/cli/openapi-parser/src/utils/getValue.ts new file mode 100644 index 00000000000..d10a92c9870 --- /dev/null +++ b/packages/cli/openapi-parser/src/utils/getValue.ts @@ -0,0 +1,6 @@ +export function getValueIfBoolean(value: unknown): boolean | undefined { + if (value != null && typeof value === "boolean") { + return value; + } + return undefined; +}