Repository navigation
fix(models): make FMP-omittable ExchangeVariant and screener fields optional - #388
Merged
Merged
Conversation
…ional Members that FMP can send as null or omit on ExchangeVariant and CompanyScreenerResult previously failed decoding a whole page when any single value was null. These members are now optional so a null value decodes to None instead of rejecting the response. **Rust response models:** * CompanyScreenerResult now types beta, price, lastAnnualDividend, country, and isFund as Option, decoding null to None and re-encoding None as null. * ExchangeVariant now types 15 members (price, range, changes, cik, isin, cusip, website, ceo, fullTimeEmployees, phone, address, city, state, zip, dcfDiff) as Option; an empty cusip also decodes to None. **Go SDK:** * CompanyScreenerResult and ExchangeVariant use pointer types for the same members, decoding null to nil and re-encoding nil as null. **Python bindings:** * The pyo3 models and generated .pyi stubs expose the same members as Optional and handle None. Because these members were previously required, code that read them as plain values must now handle the absent case. BREAKING CHANGE: ExchangeVariant and CompanyScreenerResult members FMP can omit are now optional (Option / pointer / Optional); handle None.
Document that issue #368 made the `beta` field optional, so the `company_screener_null_beta_synthetic.json` fixture now proves the null row decodes across Rust, Go, and Python. Note the decode-path proof also swaps a null `companyName` into row 37 and a string `volume` to confirm the offending value never reaches the error path.
benbenbang
enabled auto-merge (rebase)
September 30, 2026 12:57
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 send null or omit certain fields on ExchangeVariant and CompanyScreenerResult, which previously caused an entire page to fail decoding whenever any single value was null. Making these fields optional lets a null value decode gracefully instead of rejecting the whole response.
What changed:
BREAKING CHANGE: ExchangeVariant and CompanyScreenerResult members that FMP can omit are now optional (Option / pointer / Optional); callers must handle the absent case.