@Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface PathParam
value().
Example#1:
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/")
VirtualMachine getByResourceGroup(@PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String rgName, @PathParam("foo") String bar);
The value of parameters subscriptionId, resourceGroupName will be encoded and encoded value will be used to replace the corresponding path segment {subscriptionId},
{resourceGroupName} respectively.
Example#2 (A use case where PathParam.encoded=true will be used)
It is possible that, a path segment variable can be used to represent sub path:
@GET("http://wq.com/foo/{subpath}/values")
String getValues(@PathParam("subpath") String param1);
In this case, if consumer pass "a/b" as the value for param1 then the resolved url looks like: "http://wq.com/foo/a%2Fb/values"
For such cases the encoded attribute can be used:
@GET("http://wq.com/foo/{subpath}/values")
String getValues(@PathParam(value = "subpath", encoded = true) String param1);
In this case, if consumer pass "a/b" as the value for param1 then the resolved url looks as expected: "http://wq.com/foo/a/b/values"public abstract String value
public abstract boolean encoded
value() is already encoded
hence engine should not encode it, by default value will be encoded./**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/