fix(sf-rest): tolerate null name/label/type in describe responses#98
Open
jlantz wants to merge 1 commit into
Open
fix(sf-rest): tolerate null name/label/type in describe responses#98jlantz wants to merge 1 commit into
jlantz wants to merge 1 commit into
Conversation
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>
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.
What
Salesforce field/picklist describe can return JSON
nullfor String fields —FieldDescribe.{name,label,type}andPicklistValue.{value,label}.serdeerrors deserializingnullinto a non-OptionString, 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_stringdeserialize_withhelper and apply it to those fields:null→"", non-null preserved verbatim.Tests
New unit tests in
describe.rs:FieldDescribe/PicklistValuewithnullstring 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-setupto parity in busbar-broker-sf — this fix was sitting as an uncommitted local patch underbusbar-extensions/.CONTEXT/busbar-sf-api. Scoped to just the describe change; two unrelated local edits in that working copy (ziplzmafeature disable;sf-bridgemembers→exclude) are intentionally not included here.