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


Java Path.setPost方法代碼示例

本文整理匯總了Java中io.swagger.models.Path.setPost方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.setPost方法的具體用法?Java Path.setPost怎麽用?Java Path.setPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.swagger.models.Path的用法示例。


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

示例1: path2UtilSubscriptions

import io.swagger.models.Path; //導入方法依賴的package包/類
private Path path2UtilSubscriptions(Parameter idParam) {
    Path path = new Path();
    if (idParam != null) {
        path.setParameters(Collections.singletonList(paramId()));
    }

    ServiceDocument subscriptionState = template(ServiceSubscriptionState.class);
    path.setGet(opDefault(subscriptionState));

    io.swagger.models.Operation deleteOrPost = new io.swagger.models.Operation();
    deleteOrPost.addParameter(paramBody(template(ServiceSubscriber.class)));
    deleteOrPost.addTag(this.currentTag.getName());
    deleteOrPost.setResponses(responseMap(
            Operation.STATUS_CODE_OK, responseOk(subscriptionState)));
    path.setDelete(deleteOrPost);
    path.setPost(deleteOrPost);
    return path;

}
 
開發者ID:vmware,項目名稱:xenon-utils,代碼行數:20,代碼來源:SwaggerAssembler.java

示例2: path2Instance

import io.swagger.models.Path; //導入方法依賴的package包/類
private Map<String, Path> path2Instance(ServiceDocument doc) {
    if (doc.documentDescription != null
            && doc.documentDescription.serviceRequestRoutes != null
            && !doc.documentDescription.serviceRequestRoutes.isEmpty()) {
        return pathByRoutes(doc.documentDescription.serviceRequestRoutes.values(),
                this::defaultInstancePath);
    } else {
        io.swagger.models.Operation op = new io.swagger.models.Operation();
        op.addTag(this.currentTag.getName());
        op.setParameters(Collections.singletonList(paramBody(ServiceDocument.class)));
        op.setResponses(responseMap(
                Operation.STATUS_CODE_OK, responseOk(doc),
                Operation.STATUS_CODE_NOT_FOUND, responseGenericError()));

        // service definition should be introspected to better
        // describe which actions are supported
        Path path = this.defaultInstancePath();
        path.setGet(opDefault(doc));
        path.setPost(op);
        path.setPut(op);
        path.setPatch(op);
        path.setDelete(op);
        return Collections.singletonMap("", path);
    }
}
 
開發者ID:vmware,項目名稱:xenon-utils,代碼行數:26,代碼來源:SwaggerAssembler.java

示例3: createSwagger

import io.swagger.models.Path; //導入方法依賴的package包/類
private Swagger createSwagger(Operation operation) {
  Path path = new Path();
  path.setGet(operation);
  path.setPost(operation);
  path.setPut(operation);

  Swagger swagger = new Swagger();
  swagger.path("/test", path);

  return swagger;
}
 
開發者ID:mnemonic-no,項目名稱:common-services,代碼行數:12,代碼來源:SwaggerModelTransformerTest.java

示例4: path2Factory

import io.swagger.models.Path; //導入方法依賴的package包/類
private Path path2Factory(ServiceDocument doc) {
    Path path = new Path();
    path.setPost(opCreateInstance(doc));
    path.setGet(opFactoryGetInstances());
    return path;
}
 
開發者ID:vmware,項目名稱:xenon-utils,代碼行數:7,代碼來源:SwaggerAssembler.java


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