rewiringamerica / api.rewiringamerica.org

A RESTful web API for federal, state, utility and local rebates, tax credits and other electrification incentives.
https://api.rewiringamerica.org
Apache License 2.0
7 stars 0 forks source link

Clarify how to pass "items"; allow comma-separated values #543

Closed oyamauchi closed 2 months ago

oyamauchi commented 2 months ago

Description

We've seen some confusion from API clients about how to pass multiple values to this param, so clarify it in the param docs, and add the ability to pass comma-separated values.

Removing allowDots from the qs config is OK because there are no nested objects in query parameters anymore (since we flattened v1's location parameter).

Will follow up by syncing the spec into Zuplo to publish the docs.

Test Plan

Curl http://localhost:3000/api/v1/calculator with the usual required params, plus each of these:

Look in the server logs to make sure they were all parsed correctly into a two-item array of items.

(Also it turns out qs lets you mix and match these styles, but I don't think it's worth explaining that, or even saying we support it.)