plaid / plaid-ruby

Ruby bindings for Plaid
https://plaid.com/docs
MIT License
228 stars 144 forks source link

InstitutionsSearchRequest does not allow products to be null #476

Closed JoshHaver closed 11 months ago

JoshHaver commented 11 months ago

The documentation for the products param to the institutions/search api says "Provide null to get institutions regardless of supported products."

However, in the initialize method of InstitutionsSearchRequest, we only set the instance variable products if attributes[:products].is_a?(Array). This causes the products property not to be set on the InstitutionsSearchRequest instance. Then, when we use client.institutions_search(institutions_search_request) to send the http request, the products param is left out. This results in an INVALID_REQUEST error from the plaid api.

Screenshot 2023-11-16 at 7 50 05 AM
phoenixy1 commented 11 months ago

It really seems like there are two separate bugs here:

1) The client library isn't handling nil correctly in requests. 2) The validations on /institutions/search are too strict

I'm going to talk to the team that owns the /institutions/search endpoint about fixing #2, but #1 is something that it seems like should ideally be fixed, regardless of how that first issue pans out.

I can't find an existing bug filed about this on the OpenAPIGenerator side, either as a closed or an open issue.

cc: @cgfarmer4

phoenixy1 commented 11 months ago

I've merged a fix to update the validations on /institutions/search so it should no longer reject these requests. This should be deployed Real Soon Now and once deployed, it should fix this issue. Let us know next week if it's been resolved for you or not!

phoenixy1 commented 11 months ago

This should now be resolved on the server side. I didn't hear back that the bug wasn't fixed, so I'm going to close this out. Feel free to re-open if it's still happening.