I’ve came to conclusion that this isn’t one problem but two:
First, I’ll need to write custom segment serializer/deserializer that will extract id from thread-slug-id, as well as produce thread-slug-id from model. Thankfully there are hooks in routes for doing this.
Second, I’ll need way to validate within my routes that this special segment matches certain regex. How can this be done?
I couldn’t find documentation for this.route() that are used to define routes in Router.map(), so I’ve looked up source and it looks like there’s no option to do this. Looks like I’ll have to implement custom feature to router.