Buggy code:
public class ApiGatewaySdkSwaggerApiImporter extends ApiGatewaySdkApiImporter implements SwaggerApiImporter { private static final Log LOG = LogFactory . getLog ( ApiGatewaySdkSwaggerApiImporter . class ) ; private static final String DEFAULT_PRODUCES_CONTENT_TYPE = "application//json" ; private static final String EXTENSION_AUTH = "x-amazon-apigateway-auth" ; private static final String EXTENSION_INTEGRATION = "x-amazon-apigateway-integration" ; @ Inject private Swagger swagger ; @ Override public String createApi ( Swagger swagger , String name ) { } @ Override public void updateApi ( String apiId , Swagger swagger ) { } private String getApiName ( Swagger swagger , String fileName ) { } private void createModels ( RestApi api , Map < String , Model > definitions , List < String > produces ) { } private void createModel ( RestApi api , String modelName , Model model , Map < String , Model > definitions , String modelContentType ) { } private void createModel ( RestApi api , String modelName , Property model , String modelContentType ) { } private void updateMethods ( RestApi api , String basePath , Map < String , Path > paths , List < String > apiProduces ) { } private void createResources ( RestApi api , Resource rootResource , String basePath , List < String > apiProduces , Map < String , Path > paths , boolean createMethods ) { } private void createMethods ( final RestApi api , final Resource resource , Path path , List < String > apiProduces ) { } private Map < String , Operation > getOperations ( Path path ) { } private void addOp ( Map < String , Operation > ops , String method , Operation operation ) { } public void createMethod ( RestApi api , Resource resource , String httpMethod , Operation op , String modelContentType ) { PutMethodInput input = new PutMethodInput ( ) ; String authorizationType = getAuthorizationType ( op ) ; <START_BUG> input . setAuthorizationType ( authorizationType ) ; <END_BUG> input . setApiKeyRequired ( isApiKeyRequired ( op ) ) ; op . getParameters ( ) . stream ( ) . filter ( ( p ) -> p . getIn ( ) . equals ( "body" ) ) . forEach ( ( p ) -> { BodyParameter bodyParam = ( ( BodyParameter ) ( p ) ) ; Optional < String > inputModel = getInputModel ( bodyParam ) ; input . setRequestModels ( new HashMap < > ( ) ) ; if ( inputModel . isPresent ( ) ) { this . processedModels . add ( inputModel . get ( ) ) ; LOG . info ( ( "Found<seq2seq4repair_space>input<seq2seq4repair_space>model<seq2seq4repair_space>reference<seq2seq4repair_space>" + ( inputModel . get ( ) ) ) ) ; input . getRequestModels ( ) . put ( modelContentType , inputModel . get ( ) ) ; } else { String modelName = generateModelName ( bodyParam ) ; LOG . info ( ( "Creating<seq2seq4repair_space>new<seq2seq4repair_space>model<seq2seq4repair_space>referenced<seq2seq4repair_space>from<seq2seq4repair_space>parameter:<seq2seq4repair_space>" + modelName ) ) ; if ( ( bodyParam . getSchema ( ) ) == null ) { throw new IllegalArgumentException ( ( ( "Body<seq2seq4repair_space>parameter<seq2seq4repair_space>'" + ( bodyParam . getName ( ) ) ) + "'<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>schema<seq2seq4repair_space>defined" ) ) ; } createModel ( api , modelName , bodyParam . getSchema ( ) , swagger . getDefinitions ( ) , modelContentType ) ; input . getRequestModels ( ) . put ( modelContentType , modelName ) ; } } ) ; Method method = resource . putMethod ( input , httpMethod . toUpperCase ( ) ) ; createMethodResponses ( api , method , modelContentType , op . getResponses ( ) ) ; createMethodParameters ( api , method , op . getParameters ( ) ) ; createIntegration ( method , op . getVendorExtensions ( ) ) ; if ( authorizationType . equals ( "CUSTOM" ) ) { PatchDocument pd = createPatchDocument ( createReplaceOperation ( "//authorizationType" , getAuthorizationType ( op ) ) , createReplaceOperation ( "//authorizerId" , getAuthorizerId ( op ) ) ) ; method . updateMethod ( pd ) ; } } private void createIntegration ( Method method , Map < String , Object > vendorExtensions ) { } private void createIntegrationResponses ( Integration integration , Map < String , HashMap > integ ) { } private String getAuthorizationType ( Operation op ) { } private String getAuthorizerId ( Operation op ) { } private Boolean isApiKeyRequired ( Operation op ) { } private String generateSchema ( Property model , String modelName , Map < String , Model > definitions ) { } private String generateSchemaString ( Object model , String modelName , Map < String , Model > definitions ) { } private String generateSchema ( Model model , String modelName , Map < String , Model > definitions ) { } private java . util . Optional < String > getInputModel ( BodyParameter p ) { } String generateModelName ( Response response ) { } private String generateModelName ( String description ) { } private String generateModelName ( BodyParameter param ) { } private String getModelNameSanitizeRegex ( ) { } private void updateResources ( RestApi api , Resource rootResourceId , String basePath , Map < String , Path > paths , List < String > apiProduces ) { } private void updateModels ( RestApi api , Map < String , Model > definitions , List < String > apiProduces ) { } private void updateModel ( RestApi api , String modelName , Model model ) { } private void updateMethod ( RestApi api , Resource resource , String httpMethod , Operation op , String modelContentType ) { } private void cleanupMethods ( RestApi api , String basePath , Map < String , Path > paths ) { } private boolean isMethodInSwagger ( String path , String httpMethod , String basePath , Map < String , Path > paths ) { } private void cleanupResources ( RestApi api , String basePath , Map < String , Path > paths ) { } private Set < String > buildResourceSet ( Set < String > paths , String basePath ) { }

Fix:
input . setAuthorizationType ( ( authorizationType . equals ( "CUSTOM" ) ? "NONE" : authorizationType ) ) ;