Polish "Allow descriptors to be provided as a List as well as via varags"
See gh-247
This commit is contained in:
@@ -27,6 +27,7 @@ import org.springframework.restdocs.snippet.Snippet;
|
|||||||
*
|
*
|
||||||
* @author Andreas Evers
|
* @author Andreas Evers
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
|
* @author Marcel Overdijk
|
||||||
*/
|
*/
|
||||||
public abstract class HeaderDocumentation {
|
public abstract class HeaderDocumentation {
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ public abstract class HeaderDocumentation {
|
|||||||
* @see #headerWithName(String)
|
* @see #headerWithName(String)
|
||||||
*/
|
*/
|
||||||
public static RequestHeadersSnippet requestHeaders(HeaderDescriptor... descriptors) {
|
public static RequestHeadersSnippet requestHeaders(HeaderDescriptor... descriptors) {
|
||||||
return new RequestHeadersSnippet(Arrays.asList(descriptors));
|
return requestHeaders(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +72,8 @@ public abstract class HeaderDocumentation {
|
|||||||
* @return the snippet that will document the request headers
|
* @return the snippet that will document the request headers
|
||||||
* @see #headerWithName(String)
|
* @see #headerWithName(String)
|
||||||
*/
|
*/
|
||||||
public static RequestHeadersSnippet requestHeaders(List<HeaderDescriptor> descriptors) {
|
public static RequestHeadersSnippet requestHeaders(
|
||||||
|
List<HeaderDescriptor> descriptors) {
|
||||||
return new RequestHeadersSnippet(descriptors);
|
return new RequestHeadersSnippet(descriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +92,7 @@ public abstract class HeaderDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestHeadersSnippet requestHeaders(Map<String, Object> attributes,
|
public static RequestHeadersSnippet requestHeaders(Map<String, Object> attributes,
|
||||||
HeaderDescriptor... descriptors) {
|
HeaderDescriptor... descriptors) {
|
||||||
return new RequestHeadersSnippet(Arrays.asList(descriptors), attributes);
|
return requestHeaders(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,7 +126,7 @@ public abstract class HeaderDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static ResponseHeadersSnippet responseHeaders(
|
public static ResponseHeadersSnippet responseHeaders(
|
||||||
HeaderDescriptor... descriptors) {
|
HeaderDescriptor... descriptors) {
|
||||||
return new ResponseHeadersSnippet(Arrays.asList(descriptors));
|
return responseHeaders(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +161,7 @@ public abstract class HeaderDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static ResponseHeadersSnippet responseHeaders(Map<String, Object> attributes,
|
public static ResponseHeadersSnippet responseHeaders(Map<String, Object> attributes,
|
||||||
HeaderDescriptor... descriptors) {
|
HeaderDescriptor... descriptors) {
|
||||||
return new ResponseHeadersSnippet(Arrays.asList(descriptors), attributes);
|
return responseHeaders(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import java.util.Map;
|
|||||||
* Static factory methods for documenting a RESTful API that utilizes Hypermedia.
|
* Static factory methods for documenting a RESTful API that utilizes Hypermedia.
|
||||||
*
|
*
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
|
* @author Marcel Overdijk
|
||||||
*/
|
*/
|
||||||
public abstract class HypermediaDocumentation {
|
public abstract class HypermediaDocumentation {
|
||||||
|
|
||||||
@@ -63,8 +64,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
* @return the snippet that will document the links
|
* @return the snippet that will document the links
|
||||||
*/
|
*/
|
||||||
public static LinksSnippet links(LinkDescriptor... descriptors) {
|
public static LinksSnippet links(LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(new ContentTypeLinkExtractor(),
|
return links(Arrays.asList(descriptors));
|
||||||
Arrays.asList(descriptors));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,8 +108,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
* @return the snippet that will document the links
|
* @return the snippet that will document the links
|
||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(LinkDescriptor... descriptors) {
|
public static LinksSnippet relaxedLinks(LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(new ContentTypeLinkExtractor(),
|
return relaxedLinks(Arrays.asList(descriptors));
|
||||||
Arrays.asList(descriptors), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -156,8 +155,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static LinksSnippet links(Map<String, Object> attributes,
|
public static LinksSnippet links(Map<String, Object> attributes,
|
||||||
LinkDescriptor... descriptors) {
|
LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(new ContentTypeLinkExtractor(),
|
return links(attributes, Arrays.asList(descriptors));
|
||||||
Arrays.asList(descriptors), attributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -207,8 +205,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(Map<String, Object> attributes,
|
public static LinksSnippet relaxedLinks(Map<String, Object> attributes,
|
||||||
LinkDescriptor... descriptors) {
|
LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(new ContentTypeLinkExtractor(),
|
return relaxedLinks(attributes, Arrays.asList(descriptors));
|
||||||
Arrays.asList(descriptors), attributes, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,8 +226,9 @@ public abstract class HypermediaDocumentation {
|
|||||||
* @return the snippet that will document the links
|
* @return the snippet that will document the links
|
||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(Map<String, Object> attributes,
|
public static LinksSnippet relaxedLinks(Map<String, Object> attributes,
|
||||||
List<LinkDescriptor> descriptors) {
|
List<LinkDescriptor> descriptors) {
|
||||||
return new LinksSnippet(new ContentTypeLinkExtractor(), descriptors, attributes, true);
|
return new LinksSnippet(new ContentTypeLinkExtractor(), descriptors, attributes,
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -257,7 +255,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static LinksSnippet links(LinkExtractor linkExtractor,
|
public static LinksSnippet links(LinkExtractor linkExtractor,
|
||||||
LinkDescriptor... descriptors) {
|
LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(linkExtractor, Arrays.asList(descriptors));
|
return links(linkExtractor, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -305,7 +303,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
||||||
LinkDescriptor... descriptors) {
|
LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(linkExtractor, Arrays.asList(descriptors), true);
|
return relaxedLinks(linkExtractor, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -325,7 +323,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
* @return the snippet that will document the links
|
* @return the snippet that will document the links
|
||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
||||||
List<LinkDescriptor> descriptors) {
|
List<LinkDescriptor> descriptors) {
|
||||||
return new LinksSnippet(linkExtractor, descriptors, true);
|
return new LinksSnippet(linkExtractor, descriptors, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +353,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static LinksSnippet links(LinkExtractor linkExtractor,
|
public static LinksSnippet links(LinkExtractor linkExtractor,
|
||||||
Map<String, Object> attributes, LinkDescriptor... descriptors) {
|
Map<String, Object> attributes, LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(linkExtractor, Arrays.asList(descriptors), attributes);
|
return links(linkExtractor, attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -407,8 +405,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
||||||
Map<String, Object> attributes, LinkDescriptor... descriptors) {
|
Map<String, Object> attributes, LinkDescriptor... descriptors) {
|
||||||
return new LinksSnippet(linkExtractor, Arrays.asList(descriptors), attributes,
|
return relaxedLinks(linkExtractor, attributes, Arrays.asList(descriptors));
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -430,7 +427,7 @@ public abstract class HypermediaDocumentation {
|
|||||||
* @return the snippet that will document the links
|
* @return the snippet that will document the links
|
||||||
*/
|
*/
|
||||||
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
public static LinksSnippet relaxedLinks(LinkExtractor linkExtractor,
|
||||||
Map<String, Object> attributes, List<LinkDescriptor> descriptors) {
|
Map<String, Object> attributes, List<LinkDescriptor> descriptors) {
|
||||||
return new LinksSnippet(linkExtractor, descriptors, attributes, true);
|
return new LinksSnippet(linkExtractor, descriptors, attributes, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import java.util.Map;
|
|||||||
*
|
*
|
||||||
* @author Andreas Evers
|
* @author Andreas Evers
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
|
* @author Marcel Overdijk
|
||||||
*/
|
*/
|
||||||
public abstract class PayloadDocumentation {
|
public abstract class PayloadDocumentation {
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@ public abstract class PayloadDocumentation {
|
|||||||
* @see #fieldWithPath(String)
|
* @see #fieldWithPath(String)
|
||||||
*/
|
*/
|
||||||
public static RequestFieldsSnippet requestFields(FieldDescriptor... descriptors) {
|
public static RequestFieldsSnippet requestFields(FieldDescriptor... descriptors) {
|
||||||
return new RequestFieldsSnippet(Arrays.asList(descriptors));
|
return requestFields(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,7 +158,7 @@ public abstract class PayloadDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestFieldsSnippet relaxedRequestFields(
|
public static RequestFieldsSnippet relaxedRequestFields(
|
||||||
FieldDescriptor... descriptors) {
|
FieldDescriptor... descriptors) {
|
||||||
return new RequestFieldsSnippet(Arrays.asList(descriptors), true);
|
return relaxedRequestFields(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,7 +200,7 @@ public abstract class PayloadDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestFieldsSnippet requestFields(Map<String, Object> attributes,
|
public static RequestFieldsSnippet requestFields(Map<String, Object> attributes,
|
||||||
FieldDescriptor... descriptors) {
|
FieldDescriptor... descriptors) {
|
||||||
return new RequestFieldsSnippet(Arrays.asList(descriptors), attributes);
|
return requestFields(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -243,7 +244,7 @@ public abstract class PayloadDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestFieldsSnippet relaxedRequestFields(
|
public static RequestFieldsSnippet relaxedRequestFields(
|
||||||
Map<String, Object> attributes, FieldDescriptor... descriptors) {
|
Map<String, Object> attributes, FieldDescriptor... descriptors) {
|
||||||
return new RequestFieldsSnippet(Arrays.asList(descriptors), attributes, true);
|
return relaxedRequestFields(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -285,7 +286,7 @@ public abstract class PayloadDocumentation {
|
|||||||
* @see #fieldWithPath(String)
|
* @see #fieldWithPath(String)
|
||||||
*/
|
*/
|
||||||
public static ResponseFieldsSnippet responseFields(FieldDescriptor... descriptors) {
|
public static ResponseFieldsSnippet responseFields(FieldDescriptor... descriptors) {
|
||||||
return new ResponseFieldsSnippet(Arrays.asList(descriptors));
|
return responseFields(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -308,7 +309,8 @@ public abstract class PayloadDocumentation {
|
|||||||
* @return the snippet that will document the fields
|
* @return the snippet that will document the fields
|
||||||
* @see #fieldWithPath(String)
|
* @see #fieldWithPath(String)
|
||||||
*/
|
*/
|
||||||
public static ResponseFieldsSnippet responseFields(List<FieldDescriptor> descriptors) {
|
public static ResponseFieldsSnippet responseFields(
|
||||||
|
List<FieldDescriptor> descriptors) {
|
||||||
return new ResponseFieldsSnippet(descriptors);
|
return new ResponseFieldsSnippet(descriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +328,7 @@ public abstract class PayloadDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static ResponseFieldsSnippet relaxedResponseFields(
|
public static ResponseFieldsSnippet relaxedResponseFields(
|
||||||
FieldDescriptor... descriptors) {
|
FieldDescriptor... descriptors) {
|
||||||
return new ResponseFieldsSnippet(Arrays.asList(descriptors), true);
|
return relaxedResponseFields(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -369,7 +371,7 @@ public abstract class PayloadDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static ResponseFieldsSnippet responseFields(Map<String, Object> attributes,
|
public static ResponseFieldsSnippet responseFields(Map<String, Object> attributes,
|
||||||
FieldDescriptor... descriptors) {
|
FieldDescriptor... descriptors) {
|
||||||
return new ResponseFieldsSnippet(Arrays.asList(descriptors), attributes);
|
return responseFields(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -413,10 +415,11 @@ public abstract class PayloadDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static ResponseFieldsSnippet relaxedResponseFields(
|
public static ResponseFieldsSnippet relaxedResponseFields(
|
||||||
Map<String, Object> attributes, FieldDescriptor... descriptors) {
|
Map<String, Object> attributes, FieldDescriptor... descriptors) {
|
||||||
return new ResponseFieldsSnippet(Arrays.asList(descriptors), attributes, true);
|
return relaxedResponseFields(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a {@code Snippet} that will document the fields of the API operation's
|
/**
|
||||||
|
* Returns a {@code Snippet} that will document the fields of the API operation's
|
||||||
* response payload. The fields will be documented using the given {@code descriptors}
|
* response payload. The fields will be documented using the given {@code descriptors}
|
||||||
* and the given {@code attributes} will be available during snippet generation.
|
* and the given {@code attributes} will be available during snippet generation.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -447,8 +450,8 @@ public abstract class PayloadDocumentation {
|
|||||||
for (FieldDescriptor descriptor : descriptors) {
|
for (FieldDescriptor descriptor : descriptors) {
|
||||||
FieldDescriptor prefixedDescriptor = new FieldDescriptor(
|
FieldDescriptor prefixedDescriptor = new FieldDescriptor(
|
||||||
pathPrefix + descriptor.getPath())
|
pathPrefix + descriptor.getPath())
|
||||||
.description(descriptor.getDescription())
|
.description(descriptor.getDescription())
|
||||||
.type(descriptor.getType());
|
.type(descriptor.getType());
|
||||||
if (descriptor.isIgnored()) {
|
if (descriptor.isIgnored()) {
|
||||||
prefixedDescriptor.ignored();
|
prefixedDescriptor.ignored();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import org.springframework.restdocs.operation.OperationRequest;
|
|||||||
* Static factory methods for documenting aspects of a request sent to a RESTful API.
|
* Static factory methods for documenting aspects of a request sent to a RESTful API.
|
||||||
*
|
*
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
|
* @author Marcel Overdijk
|
||||||
*/
|
*/
|
||||||
public abstract class RequestDocumentation {
|
public abstract class RequestDocumentation {
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static PathParametersSnippet pathParameters(
|
public static PathParametersSnippet pathParameters(
|
||||||
ParameterDescriptor... descriptors) {
|
ParameterDescriptor... descriptors) {
|
||||||
return new PathParametersSnippet(Arrays.asList(descriptors));
|
return pathParameters(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,7 +113,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static PathParametersSnippet relaxedPathParameters(
|
public static PathParametersSnippet relaxedPathParameters(
|
||||||
ParameterDescriptor... descriptors) {
|
ParameterDescriptor... descriptors) {
|
||||||
return new PathParametersSnippet(Arrays.asList(descriptors), true);
|
return relaxedPathParameters(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -152,7 +153,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static PathParametersSnippet pathParameters(Map<String, Object> attributes,
|
public static PathParametersSnippet pathParameters(Map<String, Object> attributes,
|
||||||
ParameterDescriptor... descriptors) {
|
ParameterDescriptor... descriptors) {
|
||||||
return new PathParametersSnippet(Arrays.asList(descriptors), attributes);
|
return pathParameters(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -194,7 +195,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static PathParametersSnippet relaxedPathParameters(
|
public static PathParametersSnippet relaxedPathParameters(
|
||||||
Map<String, Object> attributes, ParameterDescriptor... descriptors) {
|
Map<String, Object> attributes, ParameterDescriptor... descriptors) {
|
||||||
return new PathParametersSnippet(Arrays.asList(descriptors), attributes, true);
|
return relaxedPathParameters(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -235,7 +236,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestParametersSnippet requestParameters(
|
public static RequestParametersSnippet requestParameters(
|
||||||
ParameterDescriptor... descriptors) {
|
ParameterDescriptor... descriptors) {
|
||||||
return new RequestParametersSnippet(Arrays.asList(descriptors));
|
return requestParameters(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -275,7 +276,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestParametersSnippet relaxedRequestParameters(
|
public static RequestParametersSnippet relaxedRequestParameters(
|
||||||
ParameterDescriptor... descriptors) {
|
ParameterDescriptor... descriptors) {
|
||||||
return new RequestParametersSnippet(Arrays.asList(descriptors), true);
|
return relaxedRequestParameters(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -317,7 +318,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestParametersSnippet requestParameters(
|
public static RequestParametersSnippet requestParameters(
|
||||||
Map<String, Object> attributes, ParameterDescriptor... descriptors) {
|
Map<String, Object> attributes, ParameterDescriptor... descriptors) {
|
||||||
return new RequestParametersSnippet(Arrays.asList(descriptors), attributes);
|
return requestParameters(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -361,7 +362,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestParametersSnippet relaxedRequestParameters(
|
public static RequestParametersSnippet relaxedRequestParameters(
|
||||||
Map<String, Object> attributes, ParameterDescriptor... descriptors) {
|
Map<String, Object> attributes, ParameterDescriptor... descriptors) {
|
||||||
return new RequestParametersSnippet(Arrays.asList(descriptors), attributes, true);
|
return relaxedRequestParameters(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -401,7 +402,7 @@ public abstract class RequestDocumentation {
|
|||||||
* @see OperationRequest#getParts()
|
* @see OperationRequest#getParts()
|
||||||
*/
|
*/
|
||||||
public static RequestPartsSnippet requestParts(RequestPartDescriptor... descriptors) {
|
public static RequestPartsSnippet requestParts(RequestPartDescriptor... descriptors) {
|
||||||
return new RequestPartsSnippet(Arrays.asList(descriptors));
|
return requestParts(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -421,7 +422,8 @@ public abstract class RequestDocumentation {
|
|||||||
* @return the snippet
|
* @return the snippet
|
||||||
* @see OperationRequest#getParts()
|
* @see OperationRequest#getParts()
|
||||||
*/
|
*/
|
||||||
public static RequestPartsSnippet requestParts(List<RequestPartDescriptor> descriptors) {
|
public static RequestPartsSnippet requestParts(
|
||||||
|
List<RequestPartDescriptor> descriptors) {
|
||||||
return new RequestPartsSnippet(descriptors);
|
return new RequestPartsSnippet(descriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,7 +440,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestPartsSnippet relaxedRequestParts(
|
public static RequestPartsSnippet relaxedRequestParts(
|
||||||
RequestPartDescriptor... descriptors) {
|
RequestPartDescriptor... descriptors) {
|
||||||
return new RequestPartsSnippet(Arrays.asList(descriptors), true);
|
return relaxedRequestParts(Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -478,7 +480,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestPartsSnippet requestParts(Map<String, Object> attributes,
|
public static RequestPartsSnippet requestParts(Map<String, Object> attributes,
|
||||||
RequestPartDescriptor... descriptors) {
|
RequestPartDescriptor... descriptors) {
|
||||||
return new RequestPartsSnippet(Arrays.asList(descriptors), attributes);
|
return requestParts(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -520,7 +522,7 @@ public abstract class RequestDocumentation {
|
|||||||
*/
|
*/
|
||||||
public static RequestPartsSnippet relaxedRequestParts(Map<String, Object> attributes,
|
public static RequestPartsSnippet relaxedRequestParts(Map<String, Object> attributes,
|
||||||
RequestPartDescriptor... descriptors) {
|
RequestPartDescriptor... descriptors) {
|
||||||
return new RequestPartsSnippet(Arrays.asList(descriptors), attributes, true);
|
return relaxedRequestParts(attributes, Arrays.asList(descriptors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user