Found this out while writing a request to change the tags on a topic.
Basically, this doesn’t work:
The server responds with:
"You are not permitted to view the requested resource."
However, if you put the topic slug on the URL, everything works fine (i.e.
This is inconsistent with the other topic API methods which do not require a slug, and differs from the behavior described in the API documentation: Discourse API Documentation
Does it work if you use a wrong slug?
I’m pretty sure the answer is No, based on previous testing, but I don’t have the time to reproduce this right now.
Yes it appears that you need the slug to be present to make the PUT request on topics and you can use the wrong slug and it will work fine.
See my demo:
Okay, so just hardcode a slug of a single dash
That’s fine for a workaround but it’s still a bug.
How is that a bug and not required syntax?
To work as expected routing depends on URLs to be in a certain format.
So this seems more like “change the way the API works with improper URLs” feature request than a bug to me.
Well, none of the other topic API methods require that, so I’d call it a bug.
Put differently, why is it reasonable for
GET /t/:topicId to work and
DELETE /t/:topicId to work and
PUT /t/:topicId to not work?
I edited the original topic to clarify why this is a bug, but I’d like to highlight that the API documentation itself states that this should work:
I think my previous point is relevant as well.
This does not meet our definition of #bug but I am totally fine for a PR that cleans this up cause it would simplify the API.