Skip to content

fix: send an explicit null in a PATCH of an item - #6

Merged
nathanfallet merged 1 commit into
mainfrom
fix/patch-explicit-null
Oct 23, 2026
Merged

nathanfallet merged 1 commit into
mainfrom
fix/patch-explicit-null

Conversation

@nathanfallet

Copy link
Copy Markdown
Member

What

  • Follow-up of the review of feat: regenerate with the platform fields of an item #5: a nullable field of ItemUpdateRequest could not be cleared. ApiClient sets NON_NULL and the models were generated with openApiNullable=false, so setPackageSizeId(null) dropped the key from the PATCH and the API kept the old value (the documented way to clear packageSizeId, measurements, places, categoryId, sizeId, state). A functional defect, not a generator quirk to accept.
  • scripts/generate.sh now generates with openApiNullable=true (JsonNullable wrappers); the generated code is regenerated from the same spec (.spec-sha256 unchanged) and jackson-databind-nullable is added to the pom. The fluent setters keep their Long/String signatures: .packageSizeId(null) sends null, an unset field is omitted.
  • README: one line on null versus unset and on lists replaced as a whole.
  • Test: explicit null sent, unset fields omitted, list sent.

Validation

mvn test green (23 tests). Nothing published to a registry.

🤖 Generated with Claude Code

The client was generated with openApiNullable=false and the mapper drops nulls,
so a nullable field of ItemUpdateRequest could not be cleared (packageSizeId,
measurements, places, categoryId, sizeId, state). Generate with JsonNullable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nathanfallet
nathanfallet merged commit 91928d8 into main Oct 23, 2026
3 checks passed
@nathanfallet
nathanfallet deleted the fix/patch-explicit-null branch October 24, 2026 09:18
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