Skip to content

fix: add OpenAPI extension index signature to contact/license types#160

Merged
mcampa merged 1 commit into
masterfrom
fix/info-object-extension-index
May 22, 2026
Merged

fix: add OpenAPI extension index signature to contact/license types#160
mcampa merged 1 commit into
masterfrom
fix/info-object-extension-index

Conversation

@mcampa
Copy link
Copy Markdown
Owner

@mcampa mcampa commented May 22, 2026

Summary

Master CI has been failing since #157 with:

```
src/generator/index.ts(71,5): error TS2322:
Type '{ license?: OpenApiLicenseObject | undefined; contact?: OpenApiContactObject | undefined; ... }'
is not assignable to type 'InfoObject'.
...
Index signature for type `x-${string}` is missing in type 'OpenApiContactObject'.
```

`zod-openapi`'s `ContactObject` and `LicenseObject` require an `[key: `x-${string}`]: any` index signature for OpenAPI extension fields. The local `OpenApiContactObject` and `OpenApiLicenseObject` interfaces introduced in #157 didn't include it, so `opts.contact` / `opts.license` couldn't be assigned to the `info` field at `src/generator/index.ts:71`.

Added the missing index signature to both interfaces.

Test plan

  • `pnpm exec tsc --noEmit` passes (2.2s, no errors)
  • `pnpm exec jest` — 129/129 tests passing across all 8 suites
  • CI green

🤖 Generated with Claude Code

OpenApiContactObject and OpenApiLicenseObject were missing the
`[key: \`x-${string}\`]: any` index signature that zod-openapi's
ContactObject and LicenseObject require, causing TS2322 in
generateOpenApiDocument and breaking CI on master.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mcampa mcampa merged commit eec9038 into master May 22, 2026
3 checks passed
@mcampa mcampa deleted the fix/info-object-extension-index branch May 22, 2026 15:37
@mcampa mcampa mentioned this pull request May 22, 2026
4 tasks
mcampa added a commit that referenced this pull request May 22, 2026
- feat: contact/license fields on GenerateOpenApiDocumentOptions (#157)
- feat: support zod v3 (>=3.25) alongside v4 via zod/v4 permalink (#161)
- fix: bump zod-openapi to 5.4.6 and raise peer dep to ^5.4.4 to prevent
  the discriminated-union crash on zod >=4.1.13 (#162)
- fix: add x-${string} index signature to contact/license types (#160)
- chore: bump h3 to ^1.15.5 (#159)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant