careerbuilder / ruby-cb-api

Ruby wrapper around the CareerBuilder.com APIs
Apache License 2.0
14 stars 18 forks source link

Optionally Add Default Params #284

Closed BradHudson closed 7 years ago

BradHudson commented 7 years ago

Problem:

Mahoneys team wants us to stop adding developerkey and outputjson to the url of the geo validation calls. My solution to this is to add an optional argument that defaults to true so that everything continues to work as normal. We can initialize the client in the geo client with 'use_default_params: false' so that it does not add these.

Staging on c-m with pre gems of ruby-cb-api and ruby-cb-api-internal:

http://insights-1.cbmtn.io/insights/assistant-store-manager?location=houston,tx

This is what the code in the internal gem will look like:

image

BradHudson commented 7 years ago

I went with feature update i dont think this is breaking since i made it optional.

brentfisher commented 7 years ago

Hey this is actually helpful for other calls we're making where I can identify when people are sharing credentials. Can we possibly just do this for the API call related to geocoding?

Casao commented 7 years ago

@brentfisher it's going to have to be done for all the DSAD APIs they said, so we went generic. We still default to sending it, you have to specifically opt out when making an API call for it to not send them as parameters.

They're still sent as headers all the time.

Does that work for your purposes?

brentfisher commented 7 years ago

Yep that helps, thanks!

BradHudson commented 7 years ago

updated with Jon's suggestion.

BradHudson commented 7 years ago

added specs

BradHudson commented 7 years ago

@ysingh @JMolinaro @MajinFro anyone else want to take a look at this before it goes live?