op-reference-container-route
@typespec/http/op-reference-container-routeCheck for referenced (op is) operations which have a @route on one of their containers.
When referencing an operation with op is, only the data on the operation itself is carried over; anything on the parent container is lost.
This results in unexpected behavior where information such as the route prefix is silently dropped.
As a best practice the route should be provided on the operation itself.
Incorrect
Section titled “Incorrect”namespace Library { @route("/pets") interface Pets { @route("/read") read(): string; }}
@servicenamespace Service { interface PetStore { readPet is Library.Pets.read; }}Correct
Section titled “Correct”namespace Library { interface Pets { @route("/pets/read") read(): string; }}
@servicenamespace Service { interface PetStore { readPet is Library.Pets.read; }}