When you have two operations in a Cadl file which result in the same route path, the rest library raises a duplicate-operation diagnostic (Playground):
import "@cadl-lang/rest";
op fooOne(): { age: int32 };
op fooOnePrime(): { name: string; };
@johanste correctly pointed out to me that in the case of a route path which might have multiple request/response pairs (an overloaded operation), this diagnostic is undesired. It seems we should depend on the emitters to decide whether they support duplicate route paths and raise their own diagnostics in that case.
It is possible for us to update the openapi3 and autorest emitters to support this, so we should consider removing the restriction and adding emitter support for operation overloads like this.
When you have two operations in a Cadl file which result in the same route path, the
restlibrary raises aduplicate-operationdiagnostic (Playground):@johanste correctly pointed out to me that in the case of a route path which might have multiple request/response pairs (an overloaded operation), this diagnostic is undesired. It seems we should depend on the emitters to decide whether they support duplicate route paths and raise their own diagnostics in that case.
It is possible for us to update the
openapi3andautorestemitters to support this, so we should consider removing the restriction and adding emitter support for operation overloads like this.