Skip to content

Commit 1209beb

Browse files
docs(feign): add detailed javadoc for RequestLine annotation parameters (#3110)
* docs(feign): add detailed javadoc for RequestLine annotation parameters * docs(feign): fixup formatting after CI/CD fail
1 parent 831447d commit 1209beb

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

core/src/main/java/feign/RequestLine.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,65 @@
3030
@Retention(RUNTIME)
3131
public @interface RequestLine {
3232

33+
/**
34+
* The HTTP request line, including the method and an optional URI template.
35+
*
36+
* <p>The string must begin with a valid {@linkplain feign.Request.HttpMethod HTTP method name}
37+
* (e.g. {@linkplain feign.Request.HttpMethod#GET GET}, {@linkplain feign.Request.HttpMethod#POST
38+
* POST}, {@linkplain feign.Request.HttpMethod#PUT PUT}), followed by a space and a URI template.
39+
* If only the HTTP method is specified (e.g. {@code "DELETE"}), the request will use the base URL
40+
* defined for the client.
41+
*
42+
* <p>Example:
43+
*
44+
* <pre>{@code @RequestLine("GET /repos/{owner}/{repo}")
45+
* Repo getRepo(@Param("owner") String owner, @Param("repo") String repo);
46+
* }</pre>
47+
*
48+
* @return the HTTP method and optional URI template for the request.
49+
* @see feign.template.UriTemplate
50+
*/
3351
String value();
3452

53+
/**
54+
* Controls whether percent-encoded forward slashes ({@code %2F}) in expanded path variables are
55+
* decoded back to {@code '/'} before sending the request.
56+
*
57+
* <p>When {@code true} (the default), any {@code %2F} sequences produced during URI template
58+
* expansion will be replaced with literal slashes, meaning that path variables containing slashes
59+
* will be interpreted as multiple path segments.
60+
*
61+
* <p>When {@code false}, percent-encoded slashes ({@code %2F}) are preserved in the final URL.
62+
* This is useful when a path variable intentionally includes a slash as part of its value (for
63+
* example, an encoded identifier such as {@code "foo%2Fbar"}).
64+
*
65+
* <p>Example:
66+
*
67+
* <pre>{@code @RequestLine(value = "GET /projects/{id}", decodeSlash = false)
68+
* Project getProject(@Param("id") String encodedId);
69+
* }</pre>
70+
*
71+
* @return {@code true} if encoded slashes should be decoded (default behavior); {@code false} to
72+
* preserve {@code %2F} sequences in the URL.
73+
*/
3574
boolean decodeSlash() default true;
3675

76+
/**
77+
* Specifies how collections (e.g. {@link java.util.List List} or arrays) are serialized when
78+
* expanded into the URI template.
79+
*
80+
* <p>Determines whether values are represented as exploded parameters (repeated keys) or as a
81+
* single comma-separated value, depending on the chosen {@link feign.CollectionFormat}.
82+
*
83+
* <p>Example:
84+
*
85+
* <ul>
86+
* <li>{@linkplain CollectionFormat#EXPLODED EXPLODED}: {@code /items?id=1&id=2&id=3}
87+
* <li>{@linkplain CollectionFormat#CSV CSV}: {@code /items?id=1,2,3}
88+
* </ul>
89+
*
90+
* @return the collection serialization format to use when expanding templates.
91+
* @see CollectionFormat
92+
*/
3793
CollectionFormat collectionFormat() default CollectionFormat.EXPLODED;
3894
}

0 commit comments

Comments
 (0)