wet-boew / wet-boew-api-standards

Possible requirements for Government of Canada APIs based on the White House standards
Other
11 stars 11 forks source link

switch from languages= to language in url #20

Closed wardi closed 10 years ago

wardi commented 10 years ago

Here is my suggestion for APIs with separate language versions based on URL.

LaurentGoderre commented 10 years ago

I personally don't agree with this. It limits to only choosing one language, as opposed to being able to send a comma separated list of language in addition to make URLs more complicated.

LaurentGoderre commented 10 years ago

For example http://api.example.gc.ca/resource/[id]?lang=en or http://api.example.gc.ca/resource/[id]?lang=es,it

wardi commented 10 years ago

@LaurentGoderre yes. I agree that it is worse than what was there before

I'm submitting this in case the decision to go with separate language endpoints comes down regardless. Requesting and merging http://api.example.gc.ca/en/resource/[id] and http://api.example.gc.ca/it/resouce/[id] is at least possible with this scheme.

LaurentGoderre commented 10 years ago

Gotcha! Fingers crossed

chrismajewski commented 10 years ago

Yea, tough call. You know at least a few environments with split languages would baulk at a single path.

Sometimes it feels like we are trying to define a single shape for water.

Lets go with that, no matter what you chose someone will want it differently but at the very least this is supported by logical structure and reasoning in use.

This will, like every thing else, be reviewed. We'd like a first presentable draft by mid early in January, we'll iterate from there.

LaurentGoderre commented 10 years ago

Can we offer both option with the other one being preferred? It would be good if all new API followed the other convention.