Skip to content

Fixed ref_data_isin request#69

Merged
dblock merged 1 commit intodblock:masterfrom
bguban:fix_ref_data_isin
Apr 10, 2020
Merged

Fixed ref_data_isin request#69
dblock merged 1 commit intodblock:masterfrom
bguban:fix_ref_data_isin

Conversation

@bguban
Copy link
Copy Markdown
Collaborator

@bguban bguban commented Apr 10, 2020

IEX cloud changed its endpoint https://iexcloud.io/docs/api/#isin-mapping. Now they expect GET requests instead of POST.
Screen Shot 2020-04-10 at 6 25 53 PM

@dangerpr-bot
Copy link
Copy Markdown

dangerpr-bot commented Apr 10, 2020

1 Warning
⚠️ [DEPRECATION] check is deprecated. Please use check! instead.

Generated by 🚫 Danger

@bguban bguban force-pushed the fix_ref_data_isin branch from ed795b5 to a08489d Compare April 10, 2020 15:28
@bguban bguban force-pushed the fix_ref_data_isin branch from a08489d to 624833c Compare April 10, 2020 15:33
@bguban bguban requested a review from dblock April 10, 2020 15:35
module RefData
def ref_data_isin(isins, options = {})
response = post('ref-data/isin', { token: publishable_token, isin: isins }.merge(options))
response = get('ref-data/isin', { token: publishable_token, isin: isins.join(',') }.merge(options))
Copy link
Copy Markdown
Collaborator

@rodolfobandeira rodolfobandeira Apr 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding a check to see if isins is indeed an array? If you pass a string for isins it will blow up

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would Array(isins) to allow a single ASIN without having to do any work.

Copy link
Copy Markdown
Owner

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this, but feel free to make the Array change on top.

module RefData
def ref_data_isin(isins, options = {})
response = post('ref-data/isin', { token: publishable_token, isin: isins }.merge(options))
response = get('ref-data/isin', { token: publishable_token, isin: isins.join(',') }.merge(options))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would Array(isins) to allow a single ASIN without having to do any work.

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.

4 participants