"Standardize API keys: CamelCase" is bad #7125

Closed
stuartpb opened this Issue Jul 19, 2014 · 8 comments

4 participants

@stuartpb

68fb7f4

This needlessly breaks backwards compatibility (see stuartpb/dokku-rethinkdb-plugin#4 for something this broke), and it's not consistent ("Id" is camelcased while "IP" is not).

@stuartpb stuartpb changed the title from "Standardize API keys: CamelCase" to "Standardize API keys: CamelCase" is bad Jul 19, 2014
@timthelion

While it might have been a mistake to lowercase the 'd' in Id, there is no going back now. However, you are wrong that the 'd' in Id should be capitalized if the 'P' in IP is. Id is a shortening of the word "identifier". So when camel cased it becomes "Id" since the beginning of each word is capitalized. IP is an acronym for Internet Protocol, and thus in camel case it is IP as the beginning of each of the two words is capitalized.

But the main point here is, that it changed once, we all had to deal with it subuser-security/subuser#162, and I certainly don't want to have to deal with yet another change ;)

I understand your frustration,
Tim

@stuartpb

However, you are wrong that the 'd' in Id should be capitalized if the 'P' in IP is. Id is a shortening of the word "identifier". So when camel cased it becomes "Id" since the beginning of each word is capitalized. IP is an acronym for Internet Protocol, and thus in camel case it is IP as the beginning of each of the two words is capitalized.

If that's the case, then what's the rationale for "Os" for "Operating System"?

What would make a hell of a lot more sense would be if it were just changed to match the capitalization of the underlying data object, so "ID" and "OS" go back to being all-caps.

@vieux
Docker member

@stuartpb the change should apply only if you use api >= 1.12

@stuartpb

The api I use is docker inspect. I don't have control over what version that uses.

@vieux
Docker member

docker version ?

@stuartpb
Client version: 1.1.1
Client API version: 1.13
Go version (client): go1.3
Git commit (client): dc62f3c
Server version: 1.1.1
Server API version: 1.13
Go version (server): go1.3
Git commit (server): dc62f3c
@vieux
Docker member

We have API versioning, please don't rely on cli output, the API is here for that.

If you call /v1.11/containers/<container_id>/json you will have the old format.

BTW we changed to have consistency between images (it was id) and containers (it was ID)

@crosbymichael

Good news is that as of our 1.0 release they are consistent across containers and images and it will not change.

Sorry about the breaking changes getting to 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment