Source:
<code>protected void updateApiResponse(Operation operation, ApiResponses responseAnnotation) { boolean contains200 = false; boolean contains2xx = false; for (ApiResponse apiResponse : responseAnnotation.value()) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); Class<?> responseClass = apiResponse.response(); Response response = new Response() .description(apiResponse.message()) .headers(responseHeaders); if (responseClass.equals(Void.class)) { if (operation.getResponses() != null) { Response apiOperationResponse = operation.getResponses().get(String.valueOf(apiResponse.code())); if (apiOperationResponse != null) { response.setSchema(apiOperationResponse.getSchema()); } } } else { Map<String, Model> models = ModelConverters.getInstance().read(responseClass); for (String key : models.keySet()) { final Property schema = new RefProperty().asDefault(key); if (apiResponse.responseContainer().equals("List")) { response.schema(new ArrayProperty(schema)); } else { response.schema(schema); } swagger.model(key, models.get(key)); } models = ModelConverters.getInstance().readAll(responseClass); for (Map.Entry<String, Model> entry : models.entrySet()) { swagger.model(entry.getKey(), entry.getValue()); } if (response.getSchema() == null) { Map<String, Response> responses = operation.getResponses(); if (responses != null) { Response apiOperationResponse = responses.get(String.valueOf(apiResponse.code())); if (apiOperationResponse != null) { response.setSchema(apiOperationResponse.getSchema()); } } } } if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (apiResponse.code() == 200) { contains200 = true; } else if (apiResponse.code() > 200 && apiResponse.code() < 300) { contains2xx = true; } } if (!contains200 && contains2xx) { <START> operation.getResponses().remove("200"); <END> } }</code><technical_language>operation.getResponses() == null</technical_language>

Target:
protected void updateApiResponse(Operation operation, ApiResponses responseAnnotation) { boolean contains200 = false; boolean contains2xx = false; for (ApiResponse apiResponse : responseAnnotation.value()) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); Class<?> responseClass = apiResponse.response(); Response response = new Response() .description(apiResponse.message()) .headers(responseHeaders); if (responseClass.equals(Void.class)) { if (operation.getResponses() != null) { Response apiOperationResponse = operation.getResponses().get(String.valueOf(apiResponse.code())); if (apiOperationResponse != null) { response.setSchema(apiOperationResponse.getSchema()); } } } else { Map<String, Model> models = ModelConverters.getInstance().read(responseClass); for (String key : models.keySet()) { final Property schema = new RefProperty().asDefault(key); if (apiResponse.responseContainer().equals("List")) { response.schema(new ArrayProperty(schema)); } else { response.schema(schema); } swagger.model(key, models.get(key)); } models = ModelConverters.getInstance().readAll(responseClass); for (Map.Entry<String, Model> entry : models.entrySet()) { swagger.model(entry.getKey(), entry.getValue()); } if (response.getSchema() == null) { Map<String, Response> responses = operation.getResponses(); if (responses != null) { Response apiOperationResponse = responses.get(String.valueOf(apiResponse.code())); if (apiOperationResponse != null) { response.setSchema(apiOperationResponse.getSchema()); } } } } if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (apiResponse.code() == 200) { contains200 = true; } else if (apiResponse.code() > 200 && apiResponse.code() < 300) { contains2xx = true; } } if (!contains200 && contains2xx) { Map<String, Response> responses = operation.getResponses(); if (responses != null) { responses.remove("200"); } } }