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

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

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

Path.post介绍

暂无

代码示例

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

protected Map<String, Path> generateEntityFilterPaths(ModelImpl entityModel) {
  return Collections.singletonMap(
      String.format(ENTITY_SEARCH, entityModel.getName()),
      new Path()
          .get(generateEntitySearchOperation(entityModel, RequestMethod.GET))
          .post(generateEntitySearchOperation(entityModel, RequestMethod.POST)));
}

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

protected Map<String, Path> generateEntityPath(ModelImpl entityModel) {
  return Collections.singletonMap(
      String.format(ENTITY_PATH, entityModel.getName()),
      new Path()
          .get(generateEntityBrowseOperation(entityModel))
          .post(generateEntityCreateOperation(entityModel)));
}

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

public Path set(String method, Operation op) {
  if ("get".equals(method)) {
    return get(op);
  }
  if ("put".equals(method)) {
    return put(op);
  }
  if ("head".equals(method)) {
    return head(op);
  }
  if ("post".equals(method)) {
    return post(op);
  }
  if ("delete".equals(method)) {
    return delete(op);
  }
  if ("patch".equals(method)) {
    return patch(op);
  }
  if ("options".equals(method)) {
    return options(op);
  }
  return null;
}

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

protected Path generateQueryPath(RestQueriesConfiguration.QueryInfo query) {
  return new Path()
      .get(generateQueryOperation(query, RequestMethod.GET))
      .post(generateQueryOperation(query, RequestMethod.POST));
}

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

protected Path generateQueryCountPath(RestQueriesConfiguration.QueryInfo query) {
  return new Path()
      .get(generateQueryCountOperation(query, RequestMethod.GET))
      .post(generateQueryCountOperation(query, RequestMethod.POST));
}

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

protected Path generateServiceMethodPath(String service, RestMethodInfo methodInfo) {
  return new Path()
      .get(generateServiceMethodOp(service, methodInfo, RequestMethod.GET))
      .post(generateServiceMethodOp(service, methodInfo, RequestMethod.POST));
}

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

private Path buildCreatePath(Path path,
    DelegatingResourceHandler<?> resourceHandler, String resourceName, String resourceParentName) {
  
  Operation postCreateOperation = null;
  
  if (resourceParentName == null) {
    if (testOperationImplemented(OperationEnum.postCreate, resourceHandler)) {
      postCreateOperation = createOperation(resourceHandler, "post", resourceName, null,
        OperationEnum.postCreate);
    }
  } else {
    if (testOperationImplemented(OperationEnum.postSubresource, resourceHandler)) {
      postCreateOperation = createOperation(resourceHandler, "post", resourceName, resourceParentName,
        OperationEnum.postSubresource);
    }
  }
  
  if (postCreateOperation != null) {
    path.post(postCreateOperation);
  }
  return path;
}

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

private Path buildUpdatePath(Path path,
    DelegatingResourceHandler<?> resourceHandler, String resourceName, String resourceParentName) {
  
  Operation postUpdateOperation = null;
  
  if (resourceParentName == null) {
    if (testOperationImplemented(OperationEnum.postUpdate, resourceHandler)) {
      postUpdateOperation = createOperation(resourceHandler, "post", resourceName, resourceParentName,
        OperationEnum.postUpdate);
    }
  } else {
    if (testOperationImplemented(OperationEnum.postUpdateSubresouce, resourceHandler)) {
      postUpdateOperation = createOperation(resourceHandler, "post", resourceName, resourceParentName,
        OperationEnum.postUpdateSubresouce);
    }
  }
  
  if (postUpdateOperation != null) {
    path.post(postUpdateOperation);
  }
  return path;
}

代码示例来源:origin: com.outbrain.swinfra/ob1k-swagger

break;
case POST:
 path.post(buildOperation(endpoint, tag, methodType));
 break;
case PUT:

代码示例来源:origin: outbrain/ob1k

break;
case POST:
 path.post(buildOperation(endpoint, tag, methodType));
 break;
case PUT:

代码示例来源:origin: vmware/admiral

this.swagger.getPath(path).post(createOperation(method, operationTags));

代码示例来源:origin: org.ballerinalang/ballerina-to-swagger

break;
case HttpConstants.ANNOTATION_METHOD_POST:
  path.post(operation);
  break;
case HttpConstants.ANNOTATION_METHOD_DELETE:

代码示例来源:origin: io.syndesis.server/server-connector-generator

@Test
public void shouldMakeNonUniqueOperationIdsUnique() {
  final Swagger swagger = new Swagger().path("/path", new Path().get(new Operation().operationId("foo"))
    .post(new Operation().operationId("foo")).put(new Operation().operationId("bar")));
  final Connector generated = generator.configureConnector(SWAGGER_TEMPLATE, new Connector.Builder().id("connector1").build(),
    createSettingsFrom(swagger));
  final List<ConnectorAction> actions = generated.getActions();
  assertThat(actions).hasSize(3);
  assertThat(actions.get(0).getId()).hasValueSatisfying(id -> assertThat(id).endsWith("foo"));
  assertThat(actions.get(1).getId()).hasValueSatisfying(id -> assertThat(id).endsWith("foo1"));
  assertThat(actions.get(2).getId()).hasValueSatisfying(id -> assertThat(id).endsWith("bar"));
}

代码示例来源:origin: io.syndesis.server/server-api-generator

@Test
public void shouldMakeNonUniqueOperationIdsUnique() {
  final Swagger swagger = new Swagger().path("/path", new Path().get(new Operation().operationId("foo"))
    .post(new Operation().operationId("foo")).put(new Operation().operationId("bar")));
  final Connector generated = generator.configureConnector(SWAGGER_TEMPLATE, new Connector.Builder().id("connector1").build(),
    createSettingsFrom(swagger));
  final List<ConnectorAction> actions = generated.getActions();
  assertThat(actions).hasSize(3);
  assertThat(actions.get(0).getId()).hasValueSatisfying(id -> assertThat(id).endsWith("foo"));
  assertThat(actions.get(1).getId()).hasValueSatisfying(id -> assertThat(id).endsWith("foo1"));
  assertThat(actions.get(2).getId()).hasValueSatisfying(id -> assertThat(id).endsWith("bar"));
}

代码示例来源:origin: com.vmware.xenon/xenon-swagger

path.post(op);
  break;
case PUT:

代码示例来源:origin: io.syndesis.server/server-api-generator

@Test
  public void shouldValidateOperationUniqueness() {
    final Swagger swagger = new Swagger()
      .path("/path", new Path().get(new Operation().operationId("o1")).post(new Operation().operationId("o2")))
      .path("/other", new Path().patch(new Operation().operationId("o2")).put(new Operation().operationId("o3")))
      .path("/more", new Path().options(new Operation().operationId("o4")).delete(new Operation().operationId("o3")));
    final SwaggerModelInfo info = new SwaggerModelInfo.Builder().model(swagger).build();
    final SwaggerModelInfo validated = SyndesisSwaggerValidationRules.validateUniqueOperationIds(info);

    final List<Violation> warnings = validated.getWarnings();
    assertThat(warnings).hasSize(1);
    final Violation nonUniqueWarning = warnings.get(0);
    assertThat(nonUniqueWarning.error()).isEqualTo("non-unique-operation-ids");
    assertThat(nonUniqueWarning.property()).isNull();
    assertThat(nonUniqueWarning.message()).isEqualTo("Found operations with non unique operationIds: o2, o3");
  }
}

代码示例来源:origin: io.syndesis.server/server-connector-generator

@Test
  public void shouldValidateOperationUniqueness() {
    final Swagger swagger = new Swagger()
      .path("/path", new Path().get(new Operation().operationId("o1")).post(new Operation().operationId("o2")))
      .path("/other", new Path().patch(new Operation().operationId("o2")).put(new Operation().operationId("o3")))
      .path("/more", new Path().options(new Operation().operationId("o4")).delete(new Operation().operationId("o3")));
    final SwaggerModelInfo info = new SwaggerModelInfo.Builder().model(swagger).build();
    final SwaggerModelInfo validated = SyndesisSwaggerValidationRules.validateUniqueOperationIds(info);

    final List<Violation> warnings = validated.getWarnings();
    assertThat(warnings).hasSize(1);
    final Violation nonUniqueWarning = warnings.get(0);
    assertThat(nonUniqueWarning.error()).isEqualTo("non-unique-operation-ids");
    assertThat(nonUniqueWarning.property()).isNull();
    assertThat(nonUniqueWarning.message()).isEqualTo("Found operations with non unique operationIds: o2, o3");
  }
}

代码示例来源:origin: com.vmware.xenon/xenon-swagger

));
path.post(post);
path.patch(post);

代码示例来源:origin: yahoo/elide

path.post(new JsonApiOperation()
    .description(postDescription)
    .tag(getTag())

代码示例来源:origin: vmware/admiral

.post(new Operation()
    .operationId(POST_NICKNAME)
    .summary(POST_VALUE)

相关文章