Skip to content

Conversation

@rmachado-studocu
Copy link
Contributor

Closes #1653

Changes

  • Detects when nullable is used in additionalProperties and creates a union type with the resulting of the previously existing code.
  • Then passes that to createIndexSignature and uses it as the resulting type.

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2025

⚠️ No Changeset found

Latest commit: edb7db9

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

@rmachado-studocu
Copy link
Contributor Author

I've ran the tests locally and one snapshot - the one related to the nullableAdditionalProperties schema - is failing, as expected.
I can update the snapshot, of course, but I would like your opinion on whether the snapshot shows the expected result or not.
Once confirmed I'll update the snapshot accordingly 👍🏻

@rmachado-studocu rmachado-studocu force-pushed the fix-issue-1653-additionalProperties-do-not-generate-null-union branch from 49cf04c to 9868d36 Compare April 15, 2025 21:39
@rmachado-studocu
Copy link
Contributor Author

I've ran the tests locally and one snapshot - the one related to the nullableAdditionalProperties schema - is failing, as expected. I can update the snapshot, of course, but I would like your opinion on whether the snapshot shows the expected result or not. Once confirmed I'll update the snapshot accordingly 👍🏻

Actually disregard that... I'll push the updated snapshot. The diff will show it 🤦🏻

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 16, 2025

More templates

@kubb/cli

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/cli@1654

@kubb/config-biome

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/config-biome@1654

@kubb/config-ts

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/config-ts@1654

@kubb/core

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/core@1654

@kubb/config-tsup

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/config-tsup@1654

@kubb/fs

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/fs@1654

kubb

npm i https://pkg.pr.new/kubb-labs/kubb@1654

@kubb/oas

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/oas@1654

@kubb/parser-ts

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/parser-ts@1654

@kubb/plugin-client

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-client@1654

@kubb/plugin-cypress

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-cypress@1654

@kubb/plugin-faker

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-faker@1654

@kubb/plugin-mcp

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-mcp@1654

@kubb/plugin-msw

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-msw@1654

@kubb/plugin-oas

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-oas@1654

@kubb/plugin-react-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-react-query@1654

@kubb/plugin-redoc

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-redoc@1654

@kubb/plugin-solid-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-solid-query@1654

@kubb/plugin-svelte-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-svelte-query@1654

@kubb/plugin-swr

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-swr@1654

@kubb/plugin-ts

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-ts@1654

@kubb/plugin-vue-query

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-vue-query@1654

@kubb/plugin-zod

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/plugin-zod@1654

@kubb/react

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/react@1654

@kubb/types

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/types@1654

@kubb/ui

npm i https://pkg.pr.new/kubb-labs/kubb/@kubb/ui@1654

unplugin-kubb

npm i https://pkg.pr.new/kubb-labs/kubb/unplugin-kubb@1654

commit: edb7db9

@stijnvanhulle
Copy link
Collaborator

@all-contributors please add @rmachado-studocu for code

@allcontributors
Copy link
Contributor

@stijnvanhulle

I've put up a pull request to add @rmachado-studocu! 🎉

@rmachado-studocu rmachado-studocu force-pushed the fix-issue-1653-additionalProperties-do-not-generate-null-union branch from b3ed6c8 to 85dcff3 Compare April 16, 2025 13:56
@rmachado-studocu rmachado-studocu force-pushed the fix-issue-1653-additionalProperties-do-not-generate-null-union branch from 85dcff3 to edb7db9 Compare April 16, 2025 17:23
@stijnvanhulle stijnvanhulle merged commit d69efdf into kubb-labs:main Apr 17, 2025
8 checks passed
@rmachado-studocu rmachado-studocu deleted the fix-issue-1653-additionalProperties-do-not-generate-null-union branch April 17, 2025 10:01
@rmachado-studocu
Copy link
Contributor Author

Thank you for merging @stijnvanhulle!

Just a question related to the release process.
I see that there was no changeset defined, and I didn't read the docs on the CONTRIBUTING.md regarding them 🤦🏻
This means we'll have to wait until a new PR is done for it to happen or should I open a new PR creating the changeset?

Thanks in advance 🙇🏻

@rmachado-studocu
Copy link
Contributor Author

Thank you for merging @stijnvanhulle!

Just a question related to the release process. I see that there was no changeset defined, and I didn't read the docs on the CONTRIBUTING.md regarding them 🤦🏻 This means we'll have to wait until a new PR is done for it to happen or should I open a new PR creating the changeset?

Thanks in advance 🙇🏻

I've created a PR to address the missing changeset: #1657

Sorry once again, completely missed that one 🤦🏻

@stijnvanhulle
Copy link
Collaborator

@rmachado-studocu Indeed, there should be a changelog so we could create a new version. I will add one and release a new version for you :)

rmachado-studocu added a commit to rmachado-studocu/kubb that referenced this pull request Apr 17, 2025
@rmachado-studocu
Copy link
Contributor Author

Ok I'll close the PR then 👍🏻 Thank you.

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.

additionalProperties with nullable: true do not generate the | null union type

2 participants