本文整理匯總了Java中io.swagger.models.Path.getPost方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.getPost方法的具體用法?Java Path.getPost怎麽用?Java Path.getPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.swagger.models.Path
的用法示例。
在下文中一共展示了Path.getPost方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getOperation
import io.swagger.models.Path; //導入方法依賴的package包/類
public Operation getOperation() {
Path p = swagger.getPath(path.toString());
if (p != null) {
switch (method) {
case GET:
return p.getGet();
case POST:
return p.getPost();
case PUT:
return p.getPut();
case DELETE:
return p.getDelete();
case PATCH:
return p.getPatch();
default:
return null;
}
}
return null;
}
示例2: extractApiOperation
import io.swagger.models.Path; //導入方法依賴的package包/類
/**
* @param swagger Swagger specification
* @param path path of the requested operation
* @param apiPath path of
* @return {@link ApiOperation} if the provided swagger does contain the requested method at the
* provided path, <code>null</code> otherwise
*/
public static ApiOperation extractApiOperation(@NonNull Swagger swagger, @NonNull String path,
@NonNull Path apiPath) {
Method realMethod = Method.GET;
if (apiPath.getGet() != null) {
realMethod = Method.GET;
}
if (apiPath.getPost() != null) {
realMethod = Method.POST;
}
ApiOperationMatch apiOperationMatch =
new ApiOperationResolver(swagger, null).findApiOperation(path, realMethod);
return apiOperationMatch.isPathFound() && apiOperationMatch.isOperationAllowed()
? apiOperationMatch.getApiOperation()
: null;
}
示例3: getNewWildCardPathObject
import io.swagger.models.Path; //導入方法依賴的package包/類
private Path getNewWildCardPathObject(Path userDefinedWildCardPathObject) {
Preconditions.checkNotNull(
userDefinedWildCardPathObject, "userDefinedWildCardPathObject cannot be null");
Path path = new Path();
if (userDefinedWildCardPathObject.getGet() == null) {
path.set("get", constructReservedOperation("Get"));
}
if (userDefinedWildCardPathObject.getDelete() == null) {
path.set("delete", constructReservedOperation("Delete"));
}
if (userDefinedWildCardPathObject.getPatch() == null) {
path.set("patch", constructReservedOperation("Patch"));
}
if (userDefinedWildCardPathObject.getPost() == null) {
path.set("post", constructReservedOperation("Post"));
}
if (userDefinedWildCardPathObject.getPut() == null) {
path.set("put", constructReservedOperation("Put"));
}
return path;
}
示例4: testPrimitive
import io.swagger.models.Path; //導入方法依賴的package包/類
private void testPrimitive(Path path) {
Operation operation = path.getPost();
Assert.assertEquals(2, operation.getResponses().size());
Property result200 = operation.getResponses().get("200").getSchema();
Assert.assertEquals("integer", result200.getType());
Assert.assertEquals("int32", result200.getFormat());
Property result202 = operation.getResponses().get("202").getSchema();
Assert.assertEquals("string", result202.getType());
Assert.assertEquals(null, result202.getFormat());
}
示例5: getOperationMap
import io.swagger.models.Path; //導入方法依賴的package包/類
/**
* Returns the operations of a path as a map which preserves the insertion order.
*
* @param path the path
* @return the operations of a path as a map
*/
private static Map<HttpMethod, Operation> getOperationMap(Path path) {
Map<HttpMethod, Operation> result = new LinkedHashMap<>();
if (path.getGet() != null) {
result.put(HttpMethod.GET, path.getGet());
}
if (path.getPut() != null) {
result.put(HttpMethod.PUT, path.getPut());
}
if (path.getPost() != null) {
result.put(HttpMethod.POST, path.getPost());
}
if (path.getDelete() != null) {
result.put(HttpMethod.DELETE, path.getDelete());
}
if (path.getPatch() != null) {
result.put(HttpMethod.PATCH, path.getPatch());
}
if (path.getHead() != null) {
result.put(HttpMethod.HEAD, path.getHead());
}
if (path.getOptions() != null) {
result.put(HttpMethod.OPTIONS, path.getOptions());
}
return result;
}
示例6: testSet
import io.swagger.models.Path; //導入方法依賴的package包/類
private void testSet(Path path) {
Operation operation = path.getPost();
Property result200 = operation.getResponses().get("200").getSchema();
Assert.assertEquals(ArrayProperty.class, result200.getClass());
Assert.assertEquals(true, ((ArrayProperty) result200).getUniqueItems());
}
示例7: testList
import io.swagger.models.Path; //導入方法依賴的package包/類
private void testList(Path path) {
Operation operation = path.getPost();
Property result200 = operation.getResponses().get("200").getSchema();
Assert.assertEquals(ArrayProperty.class, result200.getClass());
Assert.assertEquals(null, ((ArrayProperty) result200).getUniqueItems());
}
示例8: testMap
import io.swagger.models.Path; //導入方法依賴的package包/類
private void testMap(Path path) {
Operation operation = path.getPost();
Property result200 = operation.getResponses().get("200").getSchema();
Assert.assertEquals(MapProperty.class, result200.getClass());
}