本文整理匯總了Java中io.swagger.models.Path.delete方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.delete方法的具體用法?Java Path.delete怎麽用?Java Path.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.swagger.models.Path
的用法示例。
在下文中一共展示了Path.delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildSwagger
import io.swagger.models.Path; //導入方法依賴的package包/類
private Swagger buildSwagger(final Request request) {
final Swagger swagger = new Swagger();
swagger.host(request.getHeader("Host"));
swagger.info(buildInfo());
for (final Map.Entry<String, Map<HttpRequestMethodType, ServerEndpointView>> entry :
serviceRegistry.getRegisteredEndpoints().entrySet()) {
final Path path = new Path();
for (final Map.Entry<HttpRequestMethodType, ServerEndpointView> endpointEntry : entry.getValue().entrySet()) {
final HttpRequestMethodType methodType = endpointEntry.getKey();
final String key = entry.getKey();
final ServerEndpointView endpoint = endpointEntry.getValue();
if (!ignoreEndpoint(endpoint)) {
final Tag tag = buildTag(endpoint.getMethod().getDeclaringClass());
swagger.addTag(tag);
switch (methodType) {
case GET:
case ANY:
path.get(buildOperation(endpoint, tag, methodType));
break;
case POST:
path.post(buildOperation(endpoint, tag, methodType));
break;
case PUT:
path.put(buildOperation(endpoint, tag, methodType));
break;
case DELETE:
path.delete(buildOperation(endpoint, tag, methodType));
break;
default:
throw new UnsupportedOperationException("Unsupported method type " + methodType);
}
swagger.path(key, path);
}
}
}
return swagger;
}
示例2: getInstancePath
import io.swagger.models.Path; //導入方法依賴的package包/類
/**
* @return the Swagger 'Path' for a relationship URL (/books/{bookID})
*/
public Path getInstancePath() {
String typeName = dictionary.getJsonAliasFor(type);
Path path = new Path();
/* The path parameter apply for all operations */
getFullLineage().stream().forEach((item) -> {
path.addParameter(item.getPathParameter());
});
Response okSingularResponse = new Response()
.description("Successful response")
.schema(new com.yahoo.elide.contrib.swagger.property.Datum(typeName));
Response okEmptyResponse = new Response()
.description("Successful response");
path.get(new JsonApiOperation()
.description("Returns an instance of type " + typeName)
.tag(getTag())
.parameter(getSparseFieldsParameter())
.parameter(getIncludeParameter())
.response(200, okSingularResponse));
path.patch(new JsonApiOperation()
.description("Modifies an instance of type " + typeName)
.tag(getTag())
.response(204, okEmptyResponse)
.parameter(new BodyParameter()
.schema(new Datum(typeName))
.name(typeName))
);
path.delete(new JsonApiOperation()
.description("Deletes an instance of type " + typeName)
.tag(getTag())
.response(204, okEmptyResponse));
decorateGlobalResponses(path);
decorateGlobalParameters(path);
return path;
}