Repository navigation
feat(directory)!: make omittable directory and index members optional - #392
Merged
Merged
Conversation
AvailableExchange, FinancialStatementSymbol, and HistoricalIndexConstituent now type the members FMP can omit as optional, and a blank value on a typed code decodes as absent so consumers observe absence directly. **Response model changes:** * `AvailableExchange.country_code` and `delay`, `FinancialStatementSymbol.reporting_currency`, and `HistoricalIndexConstituent.added_security` and `reason` are now optional across the Rust models, the Python bindings and stubs, and the Go SDK. * Blank typed codes (`countryCode`, `reportingCurrency`, `removedTicker`) now decode to `None`/`nil`, while `delay`, `added_security`, and `reason` accept null but preserve an empty string. * A missing member is still rejected: these members remain required on the wire and only null or blank maps to absence. **Test and fixture changes:** * Added Rust, Python, and Go parity tests covering null and empty decoding, wire round-trips, and the still-required missing-member path. * Updated the Dow Jones fixture to carry a null `reason` and adjusted existing assertions to unwrap the new optional members. BREAKING CHANGE: AvailableExchange, FinancialStatementSymbol and HistoricalIndexConstituent members FMP can omit are now optional, and "" on their typed codes decodes as None (Option / pointer / Optional); handle None.
Extend the directory parity tests to verify that AvailableExchange members omitted by FMP decode null and empty typed codes as nil while the key itself stays required. Update the accompanying comments to describe the omittable-member decoding path more accurately.
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 from its directory and index responses, but the models previously required them, forcing consumers to interpret placeholder values as absence. This change types those members as optional so callers observe absence directly.
AvailableExchange.country_codeanddelay,FinancialStatementSymbol.reporting_currency, andHistoricalIndexConstituent.added_securityandreasonoptional across the Rust models, Python bindings and stubs, and the Go SDK.countryCode,reportingCurrency,removedTicker) to None/nil, whiledelay,added_security, andreasonaccept null but preserve an empty string.reasonand adjust existing assertions to unwrap the new optional members.BREAKING CHANGE: AvailableExchange, FinancialStatementSymbol and HistoricalIndexConstituent members FMP can omit are now optional, and "" on their typed codes decodes as None (Option / pointer / Optional); handle None.