Skip to content

Conversation

@markandrus
Copy link
Contributor

This fixes an error when handling nullable enums:

testEnum:
  type: string
  enum:
    - foo
    - bar
    - null
  nullable: true
  TypeError [Error]: Cannot use 'in' operator to search for 'type' in null
      at file:///openapi-box/src/writer.js:294:22
      at Array.forEach (<anonymous>)
      at writeCompound (file:///openapi-box/src/writer.js:290:10)
      at writeType (file:///openapi-box/src/writer.js:176:7)
      at file:///openapi-box/src/writer.js:354:13
      at Array.forEach (<anonymous>)
      at file:///openapi-box/src/writer.js:351:24
      at CodeBlockWriter._indentBlockInternal (file:///openapi-box/node_modules/.pnpm/code-block-writer@13.0.3/node_modules/code-block-writer/esm/mod.js:261:13)
      at CodeBlockWriter.inlineBlock (file:///openapi-box/node_modules/.pnpm/code-block-writer@13.0.3/node_modules/code-block-writer/esm/mod.js:236:14)
      at writeObject (file:///openapi-box/src/writer.js:350:11)

@dpaez dpaez requested a review from tinchoz49 June 6, 2025 12:34
@dpaez
Copy link
Contributor

dpaez commented Jun 6, 2025

LGTM

@tinchoz49 tinchoz49 merged commit ed1258d into geut:main Jun 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants