no-rpc-path-params
@azure-tools/typespec-azure-core/no-rpc-path-paramsOperations defined using RpcOperation or LongRunningRpcOperation should not have path parameters. If path parameters are needed, consider using ResourceAction or ResourceCollectionAction instead.
โ Incorrect
Section titled โโ Incorrectโ@path parameter in an RpcOperation:
op testOne is RpcOperation< { @path bar: string; }, {}>;@path parameter in a custom operation extending RpcOperation:
op customOp<TFoo extends TypeSpec.Reflection.Model> is RpcOperation< { @path bar: string; }, TFoo>;
op testTwo is customOp<{}>;@path parameter in a LongRunningRpcOperation:
@pollingOperation(getStatus)op lrRpcOp is Azure.Core.LongRunningRpcOperation< { @path foo: string; }, {}, PollingStatus, StatusError>;โ Correct
Section titled โโ CorrectโRpcOperation without path parameters:
op analyze is RpcOperation< { @body request: AnalysisRequest; }, AnalysisResult>;Use ResourceAction or ResourceCollectionAction when path parameters are needed:
op analyze is ResourceAction<MyResource, AnalysisRequest, AnalysisResult>;