<div dir="ltr">Over in this <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg14226.html">thread</a> was a discussion on API versioning and implementing via Accept: headers vs. adding a version in the URL. Looks like using a version in the URL is winning.<div>
<br></div><div>We have existing chained actions that might look like this:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>/account/<id>/widget/<id></div></blockquote><div>
<br></div><div>If want to migrate to a new version scheme in the URL like this:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>/api/v1/account/<id>/widget/<id></div></blockquote>
<div><br></div><div>This would be the same action chain as the first path -- and both would work at the same time.</div><div><br></div><div>Is there any way to support both actions via Chained dispatching? Or will I need a role that looks for that pattern and strips it of the request during prepare_action?</div>
<div><br></div><div>I've done something similar in the past where I added a language tag at the start of every path:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>/en_us/some/path/1234</div>
</blockquote></div><div><br></div><div>I strip that off and then update $c->req->path for dispatching.</div><div><div><br></div><div><br></div><div><br></div><div>Again, I'm in the Accept: header camp for versioning, but I'm finding more and more discussion on using URLs. There's an <a href="http://pages.apigee.com/web-api-design-ebook.html">e-book </a>that seems to be cited often. I'd be interested in other's view on that book -- it seems written from a practical Rails programmer point of view instead of a REST purist view. There's a lot in that e-book I don't really agree with (plural nouns?), but the practical usage seems to be winning out. Hope it's not a mistake in the long run.</div>
<div><br></div><div><div><br></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>
</div></div></div>