Skip to content

fix(sf-rest): tolerate null name/label/type in describe responses#98

Open
jlantz wants to merge 1 commit into
mainfrom
fix/describe-null-string-fields
Open

fix(sf-rest): tolerate null name/label/type in describe responses#98
jlantz wants to merge 1 commit into
mainfrom
fix/describe-null-string-fields

Conversation

@jlantz

@jlantz jlantz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Salesforce field/picklist describe can return JSON null for String fields — FieldDescribe.{name,label,type} and PicklistValue.{value,label}. serde errors deserializing null into a non-Option String, which fails the entire describe parse and breaks every consumer (sf-schema, sf-data, sf-busbar-setup) against that org.

Fix

Add a null_as_empty_string deserialize_with helper and apply it to those fields: null"", non-null preserved verbatim.

Tests

New unit tests in describe.rs: FieldDescribe/PicklistValue with null string fields deserialize to "" (these fail without the fix), plus a non-null-preserved assertion. cargo test -p busbar-sf-rest describe → 29 passed.

Notes

Found while bringing busbar-actions/sf-busbar-setup to parity in busbar-broker-sf — this fix was sitting as an uncommitted local patch under busbar-extensions/.CONTEXT/busbar-sf-api. Scoped to just the describe change; two unrelated local edits in that working copy (zip lzma feature disable; sf-bridge members→exclude) are intentionally not included here.

Salesforce field/picklist describe can return JSON null for String fields
(FieldDescribe.name/label/type, PicklistValue.value/label). serde errors
deserializing null into a non-Option String, which fails the ENTIRE describe
parse and breaks any consumer (sf-schema, sf-data, sf-busbar-setup) on that org.

Add a `null_as_empty_string` deserializer and apply it to those fields so null
maps to "" while non-null values are preserved. Covered by new unit tests
(null → "", and non-null preserved).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jlantz jlantz had a problem deploying to GitHub composable-delivery June 24, 2026 19:28 — with GitHub Actions Failure
@jlantz jlantz had a problem deploying to GitHub composable-delivery June 24, 2026 19:28 — with GitHub Actions Failure
@jlantz jlantz had a problem deploying to GitHub composable-delivery June 24, 2026 19:28 — with GitHub Actions Failure
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