Little mistake in the API manual


(Coin-coin le Canapin) #1

Hi, on the update topic entry, there is what seems to be a little mistake in the path:

Should be: /t/{slug}/{id}.json I guess?

(Jeff Atwood) #2

Is this something we can address @blake?

(Blake Erickson) #3

Yes, it probably should say {slug}, but using a - or any random (but valid) character works because the rails router will just look it up by topic id if it doesn’t find the slug.

I’m pretty sure this syntax is used in more than one place because sometimes you just don’t know the slug so this is a hack work around.

I’ll look into changing this so that it says {slug} in all the right places and also document the - trick since it is handy. Pull-Requests are welcome though!

(Blake Erickson) #4

I updated the api docs for the update topic route so that the url includes the slug and added a little tip about using the - trick.

(Blake Erickson) #5