本文整理匯總了Java中io.swagger.models.Path.setGet方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.setGet方法的具體用法?Java Path.setGet怎麽用?Java Path.setGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.swagger.models.Path
的用法示例。
在下文中一共展示了Path.setGet方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: path2UtilConfig
import io.swagger.models.Path; //導入方法依賴的package包/類
private Path path2UtilConfig(Parameter idParam) {
Path path = new Path();
if (idParam != null) {
path.setParameters(Collections.singletonList(paramId()));
}
io.swagger.models.Operation op = new io.swagger.models.Operation();
op.addTag(this.currentTag.getName());
op.setResponses(responseMap(
Operation.STATUS_CODE_OK, responseOk(template(ServiceConfiguration.class)),
Operation.STATUS_CODE_NOT_FOUND, responseGenericError()));
path.setGet(op);
op = new io.swagger.models.Operation();
op.addTag(this.currentTag.getName());
op.setParameters(
Collections.singletonList(paramBody(ServiceConfigUpdateRequest.class)));
op.setResponses(responseMap(
Operation.STATUS_CODE_OK, responseOk(template(ServiceConfiguration.class)),
Operation.STATUS_CODE_NOT_FOUND, responseGenericError()));
path.setPatch(op);
return path;
}
示例3: 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);
}
}
示例4: path2UtilTemplate
import io.swagger.models.Path; //導入方法依賴的package包/類
private Path path2UtilTemplate(Parameter idParam) {
Path path = new Path();
if (idParam != null) {
path.setParameters(Collections.singletonList(paramId()));
path.setGet(opDefault(template(ServiceDocument.class)));
} else {
// idParam == null -> it is a factory
path.setGet(opDefault(template(ServiceDocumentQueryResult.class)));
}
return path;
}
示例5: path2UtilAvailable
import io.swagger.models.Path; //導入方法依賴的package包/類
private Path path2UtilAvailable(Parameter idParam) {
Path path = new Path();
if (idParam != null) {
path.setParameters(Collections.singletonList(paramId()));
}
io.swagger.models.Operation get = new io.swagger.models.Operation();
get.addTag(this.currentTag.getName());
get.setResponses(responseMap(
Operation.STATUS_CODE_OK, responseOk(),
Operation.STATUS_CODE_UNAVAILABLE, responseNoContent(),
Operation.STATUS_CODE_NOT_FOUND, responseGenericError()));
path.setGet(get);
io.swagger.models.Operation patchOrPut = new io.swagger.models.Operation();
patchOrPut.addTag(this.currentTag.getName());
patchOrPut.setParameters(Collections.singletonList(paramBody(ServiceStat.class)));
patchOrPut.setResponses(responseMap(
Operation.STATUS_CODE_OK, responseOk(template(ServiceStats.class)),
Operation.STATUS_CODE_NOT_FOUND, responseGenericError()));
path.put(patchOrPut);
path.patch(patchOrPut);
return path;
}
示例6: 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;
}
示例7: 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;
}