Skip to content

feat(funds)!: make omittable fund members optional - #390

Merged
benbenbang merged 1 commit into
mainfrom
feat/368-funds-nullable
Sep 30, 2026
Merged

benbenbang merged 1 commit into
mainfrom
feat/368-funds-nullable

Conversation

@benbenbang

Copy link
Copy Markdown
Member

FMP can omit several members that were previously modelled as required and
non-null. Make them optional across the Rust, Python, and Go SDKs so callers
can handle their absence instead of decoding failing.

Optional members:

  • EtfFundHolding.asset, isin, and security_cusip now decode a null or
    empty string as None.
  • FundDisclosure.symbol and isin now decode as None; symbol accepts a
    null but still rejects an empty string, while isin accepts both.
  • FundDisclosureSearchResult.address now decodes a null as None and keeps
    an empty string as Some("").

Decoding support:

  • Added a required_option deserializer in libfmp for members that map null to
    None without collapsing an empty string, and dropped the now-unused
    dead_code allowance on empty_or_null.
  • Reworked the Go shadow structs to hold raw JSON for the optional members and
    reflect null and empty values into nil pointers.

Tests:

  • Extended the Rust, Python, and Go suites to assert null and empty members
    decode to None/nil and re-encode as null, and taught assert_contract to
    accept a nullable-member list.

BREAKING CHANGE: EtfFundHolding, FundDisclosure and FundDisclosureSearchResult
members FMP can omit are now optional (Option / pointer / Optional); handle
None.

FMP can omit several members that were previously modelled as required and
non-null. Make them optional across the Rust, Python, and Go SDKs so callers
can handle their absence instead of decoding failing.

**Optional members:**
* `EtfFundHolding.asset`, `isin`, and `security_cusip` now decode a null or
  empty string as `None`.
* `FundDisclosure.symbol` and `isin` now decode as `None`; `symbol` accepts a
  null but still rejects an empty string, while `isin` accepts both.
* `FundDisclosureSearchResult.address` now decodes a null as `None` and keeps
  an empty string as `Some("")`.

**Decoding support:**
* Added a `required_option` deserializer in libfmp for members that map null to
  `None` without collapsing an empty string, and dropped the now-unused
  `dead_code` allowance on `empty_or_null`.
* Reworked the Go shadow structs to hold raw JSON for the optional members and
  reflect null and empty values into nil pointers.

**Tests:**
* Extended the Rust, Python, and Go suites to assert null and empty members
  decode to `None`/nil and re-encode as null, and taught `assert_contract` to
  accept a nullable-member list.

BREAKING CHANGE: EtfFundHolding, FundDisclosure and FundDisclosureSearchResult
members FMP can omit are now optional (Option / pointer / Optional); handle
None.
@benbenbang
benbenbang enabled auto-merge (rebase) September 30, 2026 13:21
@github-actions github-actions Bot added the enhancement New feature or request label Sep 30, 2026
@benbenbang
benbenbang merged commit 64eab5b into main Sep 30, 2026
9 checks passed
@benbenbang
benbenbang deleted the feat/368-funds-nullable branch September 30, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant