Repository navigation
Conversation
populateNullableTypes now drops `nullable: true` from the schema it wraps
into `anyOf: [schema, { type: "null" }]`. The tests added in #306 pinned
the old behaviour, including the documented compounding when a schema is
visited twice. With the flag gone the function is idempotent, so that
test now asserts exactly that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The request body and response helpers each carried the same loop over `content`, and components/Response.ts inlined it a third time, including a fallback branch the preceding `invariant` already rules out. All three now go through populateNullableTypesForContent. populateNullableTypesForPathItem no longer accepts a Reference Object: Path.fromDoc only ever passes a PathItemObject, so that branch was unreachable. Adds tests for the request body, response and path item helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wrapping a nullable schema into `anyOf: [schema, { type: "null" }]` left
`description` and `deprecated` on the inner branch. JSDoc is generated
from the wrapper the property points to, so both were dropped. With
inline request bodies now being rewritten as well, this removed the
`@deprecated` tag and the description from `updateSchedule` and
`x-update-schedule` on PATCH /v2/stacks/{stackId}.
Both annotations now move onto the wrapper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mfal
force-pushed
the
fix/respect-nullable-property
branch
from
October 16, 2026 07:53
af5920a to
c963065
Compare
mfal
enabled auto-merge (squash)
October 16, 2026 08:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nullable: truewas only turned into| nullfor component schemas (Components.Schemas). Schemas defined inline in an operation – request bodies, responses, parameters – kept theirnullableflag, and the generated type silently dropped it.The API relies on this, e.g.
PATCH /v2/stacks/{stackId}documentsx-update-scheduleas "Set tonullto remove the schedule", which the client could not express so far.Changes
populateNullableTypesis now also applied to path items (parameters, request bodies, responses) and tocomponents.parameters,components.requestBodiesandcomponents.responses.nullable: true. This makes the rewrite idempotent: visiting a schema twice no longer stacks another| null.descriptionanddeprecatedmove onto theanyOfwrapper, so the generated JSDoc (including@deprecated) survives.populateNullableTypesForContent.Effect on the generated client
Regenerated locally against the committed specs (v2 and v3-next); not part of this PR, it lands with the next "update generated client" run. The diff consists only of added
| null, no JSDoc is lost. All 18 inlinenullableoccurrences in the v2 spec are covered, except those in deprecated operations, which the generator skips anyway. Examples:PATCH /v2/stacks/{stackId}:updateSchedule,x-update-schedulePATCH /v2/contributors/{contributorId}and.../extensions/{extensionId}:descriptions,webhookUrls, …PATCH /v2/mail-addresses/{mailAddressId}/autoresponder:autoResponderPATCH /v2/{projects,servers}/{id}/storage-space-statistics:notificationThresholdInBytesGET /v2/page-insightsresponse:metrics[].scoreConsumers that pass these values now have to handle
nullin response types (score), request types only get wider.Testing
populateNullableTypes.test.tsupdated for the stripped flag, new tests for the request body, response and path item helpers and for the JSDoc annotations.yarn test:unit(generator),tsc --noEmit, lint: green.🤖 Generated with Claude Code