Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InsiderTransactionResponse TransactionShares #124

Merged

Conversation

nswilder
Copy link
Contributor

InsiderTransactionResponse defines fields TransactionShares, TranShares and PostShares as a nullable long, but IEX sometimes returns it with decimals causing a Json deserialization exception.

Example response from IEX for symbol DIS.
TransactionShares: 595.2000122070312

Exception:
System.Text.Json: The JSON value could not be converted to System.Nullable`1[System.Int64]. Path: $[0].transactionShares | LineNumber: 0 | BytePositionInLine: 321. System.Text.Json.Rethrowable: Either the JSON value is not in a supported format, or is out of bounds for an Int64.

IEX docs define it as type 'number'.

This PR changes them to nullable decimal to fix #123

…ong to nullable decimal. Fixes exception reported in vslee#123. Json parse error when IEX sends decimal values and cannot be parsed to long.

Fixes issue vslee#123.
@vslee vslee merged commit db7159f into vslee:main Apr 28, 2022
@vslee
Copy link
Owner

vslee commented Apr 28, 2022

Thanks for your contribution! It is now incorporated into the latest pre-release.

@nswilder nswilder deleted the insidertransactionresponse-transactionshares-fix branch April 29, 2022 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when number of shares in InsiderTransactionResponse is a decimal
2 participants