[core] core-client-rest PathUnchecked
does not infer path parameters which are not preceded by /
#30654
Labels
PathUnchecked
does not infer path parameters which are not preceded by /
#30654
Example (made by generating the Batch modular SDK from TypeSpec when using
pathUnchecked
instead ofpath
):There are two URL parameters, so the function should accept 3 arguments, but compilation fails with:
This is because the definition of
PathParameters
in@azure/core-client-rest
assumes that each path parameter is preceded immediately by a/
. This is not necessarily true, as in this example. Because of this assumption, the type helper indicates that this path has 0 path parameters, when in reality it has 2.There is no actual runtime impact since the algorithm that actually fills in the template with the values doesn't care if the template parameter is preceded by a
/
or not.If possible, we should update the type definition of
PathParameters
to accommodate this scenario.The text was updated successfully, but these errors were encountered: