当前位置: 首页>>代码示例>>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;未经允许,请勿转载。