本文整理匯總了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;
}
示例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);
}
}
示例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;
}
示例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;
}