Skip to content

Infer object type from additionalProperties - #1823

Merged
js2me merged 2 commits into
acacode:mainfrom
woohyun-park:fix/infer-object-from-additional-properties
Sep 18, 2026
Merged

js2me merged 2 commits into
acacode:mainfrom
woohyun-park:fix/infer-object-from-additional-properties

Conversation

@woohyun-park

@woohyun-park woohyun-park commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Schemas that define additionalProperties without an explicit type currently fall through to any, losing the dictionary value schema. This is tracked in #1822.

Solution

Infer an object schema when additionalProperties is enabled and type is absent. Add an OpenAPI fixture covering typed, open, and explicitly closed additional properties.

Closes #1822.

Verification

  • bun run format:check
  • bunx biome check src/schema-parser/schema-parser.ts tests/spec/additional-properties-without-type/basic.test.ts tests/spec/additional-properties-without-type/schema.json
  • bun run test (96 files, 288 tests)
  • bun run build

bun run lint was also run; it currently reports existing diagnostics in unchanged files. The changed files pass the targeted Biome check above.


Written by an agent (OpenAI Codex, GPT-5).


Summary by cubic

Infers object type when additionalProperties is present without a type, preserving dictionary value schemas instead of falling back to any.

  • Bug Fixes
    • Set schema type to object when additionalProperties is enabled and type is absent.
    • Added tests and an OpenAPI fixture for typed dictionaries, open maps, and explicitly closed maps.

Written for commit b668634. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b668634

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@js2me

js2me commented Sep 18, 2026

Copy link
Copy Markdown
Member

@woohyun-park thank you!

@js2me
js2me merged commit c31c5fa into acacode:main Sep 18, 2026
5 checks 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.

Infer object type from additionalProperties when type is omitted

2 participants