Skip to content

feat(company): make provider-omittable company members optional - #383

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

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

Conversation

@benbenbang

Copy link
Copy Markdown
Member

This commit relaxes company response models so members FMP can omit or send as null decode to None instead of failing, keeping the rest of each model strictly required.

Model changes:

  • In libfmp, wraps the optional members in Option, adds a required_option deserializer for null-tolerant fields, and decodes an empty or null ipoDate via empty_or_null_date; nullable market-cap, float-shares, and option-award now serialize through the serialize_option codecs.
  • In the Python bindings, updates both the Rust structs and the generated .pyi stubs so the affected getters and constructor arguments expose Optional, mapping inner values through on conversion.
  • In the Go SDK, switches the affected fields to pointers, decodes null members to nil through jsontext.Value shadows while still rejecting missing required keys, and reports the first missing member as before.

Tests and fixtures:

  • Extends the Rust, Python, and Go suites to assert None/nil decoding, null wire round-trips, and that a missing key still fails; updates fixtures to carry null and empty values for the newly optional members.

BREAKING CHANGE: CompanyProfile, CompanyExecutive, CompanyMarketCapitalization, CompanyNote, CompanyShareFloat, ShareFloat, ExecutiveCompensation and MergerAcquisition members FMP can omit are now optional (Option / pointer / Optional); handle None.

This commit relaxes company response models so members FMP can omit or send as null decode to None instead of failing, keeping the rest of each model strictly required.

**Model changes:**
* In `libfmp`, wraps the optional members in `Option`, adds a `required_option` deserializer for null-tolerant fields, and decodes an empty or null `ipoDate` via `empty_or_null_date`; nullable market-cap, float-shares, and option-award now serialize through the `serialize_option` codecs.
* In the Python bindings, updates both the Rust structs and the generated `.pyi` stubs so the affected getters and constructor arguments expose `Optional`, mapping inner values through on conversion.
* In the Go SDK, switches the affected fields to pointers, decodes null members to nil through `jsontext.Value` shadows while still rejecting missing required keys, and reports the first missing member as before.

**Tests and fixtures:**
* Extends the Rust, Python, and Go suites to assert None/nil decoding, null wire round-trips, and that a missing key still fails; updates fixtures to carry null and empty values for the newly optional members.

BREAKING CHANGE: CompanyProfile, CompanyExecutive, CompanyMarketCapitalization, CompanyNote, CompanyShareFloat, ShareFloat, ExecutiveCompensation and MergerAcquisition members FMP can omit are now optional (Option / pointer / Optional); handle None.
@benbenbang
benbenbang enabled auto-merge (rebase) September 30, 2026 12:32
@github-actions github-actions Bot added the enhancement New feature or request label Sep 30, 2026
@benbenbang
benbenbang merged commit 370d0b4 into main Sep 30, 2026
9 checks passed
@benbenbang
benbenbang deleted the feat/368-company-nullable branch September 30, 2026 12:46
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