Skip to content

fix(worma): handle array schema without items in ast parser#169

Open
SAY-5 wants to merge 1 commit into
alovajs:mainfrom
SAY-5:fix-array-parser-missing-items
Open

fix(worma): handle array schema without items in ast parser#169
SAY-5 wants to merge 1 commit into
alovajs:mainfrom
SAY-5:fix-array-parser-missing-items

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 18, 2026

Copy link
Copy Markdown

When an OpenAPI array schema omits items, arrayTypeParser passes undefined into ctx.next, which reaches getParserSchemaType and throws Cannot read properties of undefined (reading 'type') during worma gen. An array without items is valid (items are unconstrained), so this crashes codegen on otherwise valid documents.

This defaults the missing items to an empty schema {}, matching how objectTypeParser already falls back with schema.properties || {}. Added a regression test in test/parsers/array.spec.ts for the itemless-array case.

Fixes #830

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1f06551

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the worma label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant