{title:'@Path', updated:'8.2.0', updated:'9.0.0'}

The {@link oaj.http.annotation.Path @Path} annotation can be applied to arguments of @RemoteOp-annotated methods to denote that they are path parameters on the request.

- {@link oaj.http.annotation.Path}
  - {@link oaj.http.annotation.Path#name() name} - Path variable name.
  - {@link oaj.http.annotation.Path#serializer() serializer} - Override the part serializer.

##### Example:

| @Remote(path="/myproxy") | public interface MyProxy { | | // Explicit names specified for path parameters. | // pojo will be converted to UON notation (unless plain-text parts enabled). | @RemoteGet("/mymethod1/{foo}/{bar}") | String myProxyMethod1(@Path("foo") String foo, @Path("bar") MyPojo pojo); | | // Multiple values pulled from a PartList object. | // Same as @Path("*"). | @RemoteGet("/mymethod2/{foo}/{bar}/{baz}") | String myProxyMethod2(@Path PartList partList); | | // Multiple values pulled from a Map. | // Same as @Path("*"). | @RemoteGet("/mymethod3/{foo}/{bar}/{baz}") | String myProxyMethod3(@Path Map<String,Object> map); | | // Multiple values pulled from a bean. | // Same as @Path("*"). | @RemoteGet("/mymethod4/{foo}/{bar}/{baz}") | String myProxyMethod4(@Path MyBean myBean); | }

Single-part arguments (i.e. those with name != "*") can be any of the following types:

- Any serializable POJO - Converted to a string using the {@link oaj.httppart.HttpPartSerializer} registered with the RestClient ({@link oaj.oapi.OpenApiSerializer} by default) or associated via the {@link oaj.http.annotation.Path#serializer() @Path(serializer)} annotation.

Multi-part arguments (i.e. those with name == "*" or empty) can be any of the following types:

- {@link oaj.http.part.PartList} - Serialized as individual path parameters.
- Map - Converted to key-value pairs.
  Values serialized using the registered {@link oaj.httppart.HttpPartSerializer} ({@link oaj.oapi.OpenApiSerializer} by default).
- Bean - Converted to key-value pairs.
  Values serialized using the registered {@link oaj.httppart.HttpPartSerializer} ({@link oaj.oapi.OpenApiSerializer} by default).

See the link below for information about supported data types in OpenAPI serialization.

- OpenAPI Serializers