Repository navigation
feat(company): make provider-omittable company members optional - #383
Merged
Merged
Conversation
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 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.
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:
libfmp, wraps the optional members inOption, adds arequired_optiondeserializer for null-tolerant fields, and decodes an empty or nullipoDateviaempty_or_null_date; nullable market-cap, float-shares, and option-award now serialize through theserialize_optioncodecs..pyistubs so the affected getters and constructor arguments exposeOptional, mapping inner values through on conversion.jsontext.Valueshadows while still rejecting missing required keys, and reports the first missing member as before.Tests and fixtures:
BREAKING CHANGE: CompanyProfile, CompanyExecutive, CompanyMarketCapitalization, CompanyNote, CompanyShareFloat, ShareFloat, ExecutiveCompensation and MergerAcquisition members FMP can omit are now optional (Option / pointer / Optional); handle None.