Skip to content

Don't strip away Consul metadata if we return a single value#92

Closed
nickpegg wants to merge 1 commit into
WeAreFarmGeek:masterfrom
PagerDuty:no-single-object-strip
Closed

Don't strip away Consul metadata if we return a single value#92
nickpegg wants to merge 1 commit into
WeAreFarmGeek:masterfrom
PagerDuty:no-single-object-strip

Conversation

@nickpegg

Copy link
Copy Markdown
Contributor

Fixes an inconsistency outlined in #39 where a KV get
call returns an array if >1 value is returned, but if one value is returned it
strips away the metadata and hands back the raw value.

While this is a friendly thing to do in some cases, it creates a very annoying
inconsistency when doing a recursive get which leaves out the metadata
(most importantly the key of the returned value) as well as requiring the
consumer to check whether the return value of get is a String or Array.

Fixes an inconsistency outlined in #39 where a KV `get`
call returns an array if >1 value is returned, but if one value is returned it
strips away the metadata and hands back the raw value.

While this is a friendly thing to do in some cases, it creates a very annoying
inconsistency when doing a recursive `get` which leaves out the metadata
(most importantly the key of the returned value) as well as requiring the
consumer to check whether the return value of `get` is a String or Array.
@evan2645

Copy link
Copy Markdown

👍 we need this bad. we'll have to run a fork in the meantime

@EugenMayer

Copy link
Copy Markdown
Contributor

dupe of #51 AFAICS but i guess it is nonsense creating pull requests here anyway

@nickpegg

Copy link
Copy Markdown
Contributor Author

Closing in favor for #51

@nickpegg nickpegg closed this Jul 20, 2016
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.

3 participants