Java Code Examples for io.swagger.v3.oas.models.PathItem#put()

The following examples show how to use io.swagger.v3.oas.models.PathItem#put() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Swagger3RestDocGenerator.java    From RestDoc with Apache License 2.0 5 votes vote down vote up
private void setHttpMethod(MappingModel mapping, PathItem pathItem, Operation operation) {
    for (var httpMethod : mapping.getHttpMethods()) {
        switch (httpMethod) {
            case GET:
                pathItem.get(operation);
                break;
            case PUT:
                pathItem.put(operation);
                break;
            case POST:
                pathItem.post(operation);
                break;
            case DELETE:
                pathItem.delete(operation);
                break;
            case HEAD:
                pathItem.head(operation);
                break;
            case PATCH:
                pathItem.patch(operation);
                break;
            case TRACE:
                pathItem.trace(operation);
                break;
            case OPTIONS:
                pathItem.options(operation);
                break;
        }
    }
}
 
Example 2
Source File: OperationBuilder.java    From springdoc-openapi with Apache License 2.0 5 votes vote down vote up
/**
 * Sets path item operation.
 *
 * @param pathItemObject the path item object
 * @param method the method
 * @param operation the operation
 */
private void setPathItemOperation(PathItem pathItemObject, String method, Operation operation) {
	switch (method) {
		case POST_METHOD:
			pathItemObject.post(operation);
			break;
		case GET_METHOD:
			pathItemObject.get(operation);
			break;
		case DELETE_METHOD:
			pathItemObject.delete(operation);
			break;
		case PUT_METHOD:
			pathItemObject.put(operation);
			break;
		case PATCH_METHOD:
			pathItemObject.patch(operation);
			break;
		case TRACE_METHOD:
			pathItemObject.trace(operation);
			break;
		case HEAD_METHOD:
			pathItemObject.head(operation);
			break;
		case OPTIONS_METHOD:
			pathItemObject.options(operation);
			break;
		default:
			// Do nothing here
			break;
	}
}
 
Example 3
Source File: RaptorSwaggerConverter.java    From raptor with Apache License 2.0 5 votes vote down vote up
private void addOperation(Rpc rpc, PathItem pathItem) {
    MethodMetaInfo methodMetaInfo = MethodMetaInfo.readFrom(rpc);
    Method method = methodMetaInfo.getMethod();

    if (Objects.isNull(method)) {
        method = Method.POST;
    }
    Operation operation = getOperation(rpc);
    switch (method) {
        case GET:
            pathItem.get(operation);
            break;
        case HEAD:
            pathItem.head(operation);
            break;
        case POST:
            pathItem.post(operation);
            break;
        case PUT:
            pathItem.put(operation);
            break;
        case PATCH:
            pathItem.patch(operation);
            break;
        case DELETE:
            pathItem.delete(operation);
            break;
        case OPTIONS:
            pathItem.options(operation);
            break;
        case TRACE:
            pathItem.trace(operation);
            break;
        default:
            break;
    }
}