Open
Description
This is a bit of a contrived example, but if I declare something like:
class VersionService1 extends BaseJsonService {
//stuff
static get url() {
return {
base: 'someroute/v',
format: '(.+)',
capture: ['param'],
}
}
}
class VersionService2 extends BaseJsonService {
//stuff
static get url() {
return {
base: 'someroute/v',
format: '(.+)',
capture: ['param'],
}
}
}
module.exports = {
VersionService1,
VersionService2,
}
VersionService1
and VersionService2
are both trying to mount on the same route. When we start the server, one wins and one loses (I guess the order we register the services in is important here) but it doesn't throw an error. In the example above, it is pretty easy to debug, but once you've got services spread across multiple files this condition could become quite hard to detect.
It would be a nice safeguard if we added a check when we register the service classes which throws an error if we have declared any duplicate or conflicting routes.