Repository navigation
feat(funds)!: make omittable fund members optional - #390
Merged
Merged
Conversation
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.
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.
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, andsecurity_cusipnow decode a null orempty string as
None.FundDisclosure.symbolandisinnow decode asNone;symbolaccepts anull but still rejects an empty string, while
isinaccepts both.FundDisclosureSearchResult.addressnow decodes a null asNoneand keepsan empty string as
Some("").Decoding support:
required_optiondeserializer in libfmp for members that map null toNonewithout collapsing an empty string, and dropped the now-unuseddead_codeallowance onempty_or_null.reflect null and empty values into nil pointers.
Tests:
decode to
None/nil and re-encode as null, and taughtassert_contracttoaccept a nullable-member list.
BREAKING CHANGE: EtfFundHolding, FundDisclosure and FundDisclosureSearchResult
members FMP can omit are now optional (Option / pointer / Optional); handle
None.