amazon-archives / aws-serverless-auth-reference-app

Serverless reference app and backend API, showcasing authentication and authorization patterns using Amazon Cognito, Amazon API Gateway, AWS Lambda, and AWS IAM.
Other
754 stars 193 forks source link

Generated Java API SDK has lots of Syntax errors #51

Closed sysout closed 6 years ago

sysout commented 6 years ago

The following interface is from the generated Java SDK

/**
null
*/
package SpacefinderAPI;

import javax.annotation.Generated;

import com.amazonaws.*;
import com.amazonaws.opensdk.*;
import com.amazonaws.opensdk.model.*;
import com.amazonaws.regions.*;

import SpacefinderAPI.model.*;

/**
 * Interface for accessing SpacefinderAPI.
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public interface SpacefinderAPI {

/**
@param bookings-CreateRequest 
@return Result of the bookings-Create operation returned by the service.
@sample SpacefinderAPI.bookings-Create
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/bookings-Create" target="_top">AWS API Documentation</a>*/
Bookings-CreateResult bookings-Create(Bookings-CreateRequest bookings-CreateRequest);
/**
@param bookings-DeleteRequest 
@return Result of the bookings-Delete operation returned by the service.
@sample SpacefinderAPI.bookings-Delete
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/bookings-Delete" target="_top">AWS API Documentation</a>*/
Bookings-DeleteResult bookings-Delete(Bookings-DeleteRequest bookings-DeleteRequest);
/**
@param bookings-GetRequest 
@return Result of the bookings-Get operation returned by the service.
@sample SpacefinderAPI.bookings-Get
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/bookings-Get" target="_top">AWS API Documentation</a>*/
Bookings-GetResult bookings-Get(Bookings-GetRequest bookings-GetRequest);
/**
@param bookings-ListByResourceIdRequest 
@return Result of the bookings-ListByResourceId operation returned by the service.
@sample SpacefinderAPI.bookings-ListByResourceId
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/bookings-ListByResourceId" target="_top">AWS API Documentation</a>*/
Bookings-ListByResourceIdResult bookings-ListByResourceId(Bookings-ListByResourceIdRequest bookings-ListByResourceIdRequest);
/**
@param bookings-ListByUserIdRequest 
@return Result of the bookings-ListByUserId operation returned by the service.
@sample SpacefinderAPI.bookings-ListByUserId
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/bookings-ListByUserId" target="_top">AWS API Documentation</a>*/
Bookings-ListByUserIdResult bookings-ListByUserId(Bookings-ListByUserIdRequest bookings-ListByUserIdRequest);
/**
@param locations-CreateRequest 
@return Result of the locations-Create operation returned by the service.
@sample SpacefinderAPI.locations-Create
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/locations-Create" target="_top">AWS API Documentation</a>*/
Locations-CreateResult locations-Create(Locations-CreateRequest locations-CreateRequest);
/**
@param locations-DeleteRequest 
@return Result of the locations-Delete operation returned by the service.
@sample SpacefinderAPI.locations-Delete
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/locations-Delete" target="_top">AWS API Documentation</a>*/
Locations-DeleteResult locations-Delete(Locations-DeleteRequest locations-DeleteRequest);
/**
@param locations-GetRequest 
@return Result of the locations-Get operation returned by the service.
@sample SpacefinderAPI.locations-Get
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/locations-Get" target="_top">AWS API Documentation</a>*/
Locations-GetResult locations-Get(Locations-GetRequest locations-GetRequest);
/**
@param locations-ListRequest 
@return Result of the locations-List operation returned by the service.
@sample SpacefinderAPI.locations-List
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/locations-List" target="_top">AWS API Documentation</a>*/
Locations-ListResult locations-List(Locations-ListRequest locations-ListRequest);
/**
@param resources-CreateRequest 
@return Result of the resources-Create operation returned by the service.
@sample SpacefinderAPI.resources-Create
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/resources-Create" target="_top">AWS API Documentation</a>*/
Resources-CreateResult resources-Create(Resources-CreateRequest resources-CreateRequest);
/**
@param resources-DeleteRequest 
@return Result of the resources-Delete operation returned by the service.
@sample SpacefinderAPI.resources-Delete
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/resources-Delete" target="_top">AWS API Documentation</a>*/
Resources-DeleteResult resources-Delete(Resources-DeleteRequest resources-DeleteRequest);
/**
@param resources-GetRequest 
@return Result of the resources-Get operation returned by the service.
@sample SpacefinderAPI.resources-Get
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/resources-Get" target="_top">AWS API Documentation</a>*/
Resources-GetResult resources-Get(Resources-GetRequest resources-GetRequest);
/**
@param resources-ListRequest 
@return Result of the resources-List operation returned by the service.
@sample SpacefinderAPI.resources-List
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gc4yvjf7uf-1.0.0/resources-List" target="_top">AWS API Documentation</a>*/
Resources-ListResult resources-List(Resources-ListRequest resources-ListRequest);

    /**
    * @return Create new instance of builder with all defaults set.
    */
    public static SpacefinderAPIClientBuilder builder() {
      return new SpacefinderAPIClientBuilder();
    }

    /**
     * Shuts down this client object, releasing any resources that might be held
     * open. This is an optional method, and callers are not expected to call
     * it, but can if they want to explicitly release any open resources. Once a
     * client has been shutdown, it should not be used to make any more
     * requests.
     */
    void shutdown();

}

I download the SDK from here: screen shot 2018-01-05 at 3 45 31 pm

I am not sure it's specific to this project or a general AWS API gateway bug. If it's specific to this project, please let me how to fix it. Thank you!

sysout commented 6 years ago

Two steps to fix these Syntax errors Step 1:

find . -path "*model*" -name "*-*.java" -exec rename -v 's/\-//i' {} \;

Step 2: In eclipse replace Bookings- to Bookings, Locations- to Locations, and Resources- to Resources

justonian commented 6 years ago

Hi Xiong Xiong-

Thanks for reporting this. The feature you're referring to is unrelated to this project and is a native component of API Gateway. I personally like to use Swagger Codegen to directly generate any SDK needed in pretty much any popular programming language. You can take the Swagger template file in the \swagger folder and generate the relevant SDK from that if you want to try the Swagger Codegen alternative to the native API Gateway SDKs. You can find this at https://github.com/swagger-api/swagger-codegen