當前位置: 首頁>>代碼示例>>Java>>正文


Java OperationRequest類代碼示例

本文整理匯總了Java中org.springframework.restdocs.operation.OperationRequest的典型用法代碼示例。如果您正苦於以下問題:Java OperationRequest類的具體用法?Java OperationRequest怎麽用?Java OperationRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OperationRequest類屬於org.springframework.restdocs.operation包,在下文中一共展示了OperationRequest類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateModel

import org.springframework.restdocs.operation.OperationRequest; //導入依賴的package包/類
public Map<String, Object> generateModel(Operation operation, RamlResourceSnippetParameters parameters) {
    final OperationRequest request = operation.getRequest();

    if (!StringUtils.isEmpty(request.getContentAsString())) {
        Map<String, Object> model = new HashMap<>();
        model.put("requestBodyFileName", getRequestFileName(operation.getName()));
        model.put("requestBodyPresent", true);
        model.put("contentTypeRequest", request.getHeaders().getContentType().getType() + "/" + request.getHeaders().getContentType().getSubtype());
        if (!parameters.getRequestFields().isEmpty()) {
            validateRequestFieldsAndInferTypeInformation(operation, parameters);
            model.put("requestFieldsPresent", true);
            if (shouldGenerateRequestSchemaFile(operation, parameters)) {
                model.put("requestSchemaFileName", getRequestSchemaFileName(operation.getName()));
            }
        }
        return model;
    }
    return emptyMap();
}
 
開發者ID:ePages-de,項目名稱:restdocs-raml,代碼行數:20,代碼來源:RequestHandler.java

示例2: buildRequest

import org.springframework.restdocs.operation.OperationRequest; //導入依賴的package包/類
private OperationRequest buildRequest() {
	List<OperationRequestPart> parts = new ArrayList<>();
	for (OperationRequestPartBuilder builder : this.partBuilders) {
		parts.add(builder.buildPart());
	}
	return new OperationRequestFactory().create(this.requestUri, this.method,
			this.content, this.headers, this.parameters, parts);
}
 
開發者ID:ePages-de,項目名稱:restdocs-raml,代碼行數:9,代碼來源:OperationBuilder.java

示例3: preprocess

import org.springframework.restdocs.operation.OperationRequest; //導入依賴的package包/類
@Override
public OperationRequest preprocess(OperationRequest request) {
    return new OperationRequestAdapter(request) {
        @Override
        public URI getUri() {
            URI uri = delegate.getUri();
            try {
                return new URI(scheme, uri.getUserInfo(), host, port, uri.getPath(), uri.getQuery(), uri.getFragment());
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            }
        }
    };
}
 
開發者ID:HSLdevcom,項目名稱:parkandrideAPI,代碼行數:15,代碼來源:UriHostReplacingOperationPreprocessor.java

示例4: OperationRequestAdapter

import org.springframework.restdocs.operation.OperationRequest; //導入依賴的package包/類
public OperationRequestAdapter(OperationRequest delegate) {
    this.delegate = delegate;
}
 
開發者ID:HSLdevcom,項目名稱:parkandrideAPI,代碼行數:4,代碼來源:OperationRequestAdapter.java


注:本文中的org.springframework.restdocs.operation.OperationRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。