jonthegeek / rapid

R 'API' documents
https://rapid.api2r.org/
Other
6 stars 1 forks source link

Merge apiKey-as-parameter info into security #69

Open jonthegeek opened 1 year ago

jonthegeek commented 1 year ago

In at least one case (https://api.apis.guru/v2/specs/fec.gov/1.0/openapi.yaml), every path has an api_key parameter, which overlaps with the apiKey security scheme (which is defined as being in the query so it overlaps conceptually, too). The path versions give a default value, which seems reasonable.

Add default values to api_key security schemes (as an optional field which isn't possible to fill directly from the APID). After building the initial APID (which must include path parameters before this will make sense), merge info from overlapping parameters into the api_key specification.

By here (if not before) as_rapid() should call a function that does "clean up" work like this + the base_url stuff.