io.swagger.models.Path.getHead()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中io.swagger.models.Path.getHead()方法的一些代码示例,展示了Path.getHead()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.getHead()方法的具体详情如下:
包路径:io.swagger.models.Path
类名称:Path
方法名:getHead

Path.getHead介绍

暂无

代码示例

代码示例来源:origin: Swagger2Markup/swagger2markup

result.put(HttpMethod.PATCH, path.getPatch());
if (path.getHead() != null) {
  result.put(HttpMethod.HEAD, path.getHead());

代码示例来源:origin: googleapis/api-compiler

/** Creates a map between http verb and operation. */
private Map<String, Operation> getOperationsForPath(Path pathObj) {
 Map<String, Operation> hmap = Maps.newLinkedHashMap();
 hmap.put("get", pathObj.getGet());
 hmap.put("head", pathObj.getHead());
 hmap.put("delete", pathObj.getDelete());
 hmap.put("patch", pathObj.getPatch());
 hmap.put("post", pathObj.getPost());
 hmap.put("put", pathObj.getPut());
 hmap.put("options", pathObj.getOptions());
 return hmap;
}
/** Adds a {@link Method} from {@link Operation}. */

代码示例来源:origin: com.google.api/api-compiler

/** Creates a map between http verb and operation. */
private Map<String, Operation> getOperationsForPath(Path pathObj) {
 Map<String, Operation> hmap = Maps.newLinkedHashMap();
 hmap.put("get", pathObj.getGet());
 hmap.put("head", pathObj.getHead());
 hmap.put("delete", pathObj.getDelete());
 hmap.put("patch", pathObj.getPatch());
 hmap.put("post", pathObj.getPost());
 hmap.put("put", pathObj.getPut());
 hmap.put("options", pathObj.getOptions());
 return hmap;
}
/** Adds a {@link Method} from {@link Operation}. */

代码示例来源:origin: org.teiid.connectors/translator-swagger

public static Map<HttpMethod, Operation> getOperationMap(Path operations) {
  Map<HttpMethod, Operation> result = new LinkedHashMap<HttpMethod, Operation>();
  if (operations.getGet() != null) {
    result.put(HttpMethod.GET, operations.getGet());
  }
  if (operations.getPut() != null) {
    result.put(HttpMethod.PUT, operations.getPut());
  }
  if (operations.getPost() != null) {
    result.put(HttpMethod.POST, operations.getPost());
  }
  if (operations.getDelete() != null) {
    result.put(HttpMethod.DELETE, operations.getDelete());
  }
  if (operations.getPatch() != null) {
    result.put(HttpMethod.PATCH, operations.getPatch());
  }
  if (operations.getHead() != null) {
    result.put(HttpMethod.HEAD, operations.getHead());
  }
  if (operations.getOptions() != null) {
    result.put(HttpMethod.OPTIONS, operations.getOptions());
  }
  return result;
}

代码示例来源:origin: io.github.swagger2markup/swagger2markup

result.put(HttpMethod.PATCH, path.getPatch());
if (path.getHead() != null) {
  result.put(HttpMethod.HEAD, path.getHead());

代码示例来源:origin: io.github.kicksolutions/mock-swagger-core

/**
 * 
 * @param basePath
 * @param path
 * @param pathObject
 */
private void processSwaggerPath(String basePath, String path, io.swagger.models.Path pathObject) {
  String URI = new StringBuilder().append(StringUtils.isNotEmpty(basePath) ? basePath : "").append(path)
      .toString();
  populateSwaggerMap(URI, "GET", pathObject.getGet());
  populateSwaggerMap(URI, "POST", pathObject.getPost());
  populateSwaggerMap(URI, "DELETE", pathObject.getDelete());
  populateSwaggerMap(URI, "PATCH", pathObject.getPatch());
  populateSwaggerMap(URI, "PUT", pathObject.getPut());
  populateSwaggerMap(URI, "HEAD", pathObject.getHead());
  populateSwaggerMap(URI, "OPTIONS", pathObject.getOptions());
}

代码示例来源:origin: networknt/light-rest-4j

@Override
public Iterable<Endpoint> listEndpoints() {
  List<Endpoint> endpoints = new ArrayList<>();
  String basePath = findBasePath();
  Map<String, Path> paths = SwaggerHelper.swagger.getPaths();
  if(log.isInfoEnabled()) log.info("Generating paths from Swagger spec");
  for (Map.Entry<String, Path> pathPair : paths.entrySet()) {
    String path = basePath + pathPair.getKey();
    Path pathImpl = pathPair.getValue();
    if(pathImpl.getGet() != null) addEndpoint(endpoints, path, "get");
    if(pathImpl.getPut() != null) addEndpoint(endpoints, path, "put");
    if(pathImpl.getHead() != null) addEndpoint(endpoints, path, "head");
    if(pathImpl.getPost() != null) addEndpoint(endpoints, path, "post");
    if(pathImpl.getDelete() != null) addEndpoint(endpoints, path, "delete");
    if(pathImpl.getPatch() != null) addEndpoint(endpoints, path, "patch");
    if(pathImpl.getOptions() != null) addEndpoint(endpoints, path, "options");
  }
  return endpoints;
}

代码示例来源:origin: io.swagger/swagger-parser

private List<Operation> getAllOperationsInAPath(Path pathObj) {
  List<Operation> operations = new ArrayList<>();
  addToOperationsList(operations, pathObj.getGet());
  addToOperationsList(operations, pathObj.getPut());
  addToOperationsList(operations, pathObj.getPost());
  addToOperationsList(operations, pathObj.getPatch());
  addToOperationsList(operations, pathObj.getDelete());
  addToOperationsList(operations, pathObj.getOptions());
  addToOperationsList(operations, pathObj.getHead());
  return operations;
}

代码示例来源:origin: castlemock/castlemock

restResource.getMethods().add(restMethod);
if(resourcePath.getHead() != null){
  Operation operation = resourcePath.getHead();
  RestMethod restMethod = createRestMethod(operation, definitions, HttpMethod.HEAD, forwardAddress, generateResponse);
  restResource.getMethods().add(restMethod);

代码示例来源:origin: swagger-api/swagger-parser

v3Path.setDelete(convert(v2Operation));
v2Operation = v2Path.getHead();
if (v2Operation != null) {
  v3Path.setHead(convert(v2Operation));

代码示例来源:origin: io.swagger.parser.v3/swagger-parser-v2-converter

v3Path.setDelete(convert(v2Operation));
v2Operation = v2Path.getHead();
if (v2Operation != null) {
  v3Path.setHead(convert(v2Operation));

代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v2-converter

v3Path.setDelete(convert(v2Operation));
v2Operation = v2Path.getHead();
if (v2Operation != null) {
  v3Path.setHead(convert(v2Operation));

相关文章