Closed phrohdoh closed 5 years ago
On one of my resources, ApiService, I have the following impl:
ApiService
#[get("/api/company/:id")] #[content_type("application/json")] fn get_single_company(&self, id: u32) -> Result<SingleCompanyResponse, ()> { Ok(SingleCompanyResponse { item: Company { id, display_name: "Target".into(), aliases: vec![] } }) } #[get("/api/company/:id")] #[content_type("application/json")] fn get_single_country(&self, id: u32) -> Result<SingleCountryResponse, ()> { Ok(SingleCountryResponse { item: Country { id, display_name: "Canada".into(), tags: vec![] } }) }
The routes being duplicate is a copy & paste issue but I received no warning or error. This can lead to confusion and lost time.
It would be useful to error (or at least warn) in this scenario if at all possible.
On one of my resources,
ApiService
, I have the following impl:The routes being duplicate is a copy & paste issue but I received no warning or error. This can lead to confusion and lost time.
It would be useful to error (or at least warn) in this scenario if at all possible.