operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response);
operation.defaultResponse(new Response().description("successful operation"));
operation.defaultResponse(new Response().description("successful operation"));
/** * Processes the return value of a RequestMapping annotated method. * * @param returnType the return type. * @param operation the operation. * @param returnDescription the description of the return value. * * @throws MojoExecutionException if the return type isn't an XmlType. */ private void processRestMethodReturnValue(Class<?> returnType, Operation operation, String returnDescription) throws MojoExecutionException { log.debug("Processing REST method return value \"" + returnType.getName() + "\"."); // Add the class name to the list of classes which we will create an example for. exampleClassNames.add(returnType.getSimpleName()); // Add the success response operation.response(200, new Response().description(returnDescription == null ? "Success" : returnDescription) .schema(new RefProperty(getXmlType(returnType).name().trim()))); // If we have an error class, add that as the default response. if (modelErrorClass != null) { operation.defaultResponse(new Response().description("General Error").schema(new RefProperty(getXmlType(modelErrorClass).name().trim()))); } }
operation.defaultResponse(response); operation.defaultResponse(new Response().description("Successful request"));
operation.defaultResponse(new Response().description("successful operation"));
operation.defaultResponse(new Response().description("successful operation"));
operation.defaultResponse(responseEntry.getValue()); } else { operation.response(responseEntry.getKey(), responseEntry.getValue());
operation.defaultResponse(response);
operation.defaultResponse(responseEntry.getValue()); } else { operation.response(responseEntry.getKey(), responseEntry.getValue());
operation.defaultResponse(response);
operation.defaultResponse(response);
operation.defaultResponse(response);
private void addResponse(Operation operation, ApiResponse apiResponse) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); Response response = new Response().description(apiResponse.message()).headers(responseHeaders); if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (StringUtils.isNotEmpty(apiResponse.reference())) { response.schema(new RefProperty(apiResponse.reference())); } else if (!isVoid(apiResponse.response())) { Type responseType = apiResponse.response(); final Property property = ModelConverters.getInstance().readAsProperty(responseType); if (property != null) { response.schema(ContainerWrapper.wrapContainer(apiResponse.responseContainer(), property)); appendModels(responseType); } } }
op.defaultResponse(new Response());
private void addResponse(Operation operation, ApiResponse apiResponse) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); Response response = new Response().description(apiResponse.message()).headers(responseHeaders); if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (StringUtils.isNotEmpty(apiResponse.reference())) { response.schema(new RefProperty(apiResponse.reference())); } else if (!isVoid(apiResponse.response())) { Type responseType = apiResponse.response(); final Property property = ModelConverters.getInstance().readAsProperty(responseType); if (property != null) { response.schema(ContainerWrapper.wrapContainer(apiResponse.responseContainer(), property)); appendModels(responseType); } } }
private void addResponse(Operation operation, ApiResponse apiResponse) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); Response response = new Response().description(apiResponse.message()).headers(responseHeaders); if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (StringUtils.isNotEmpty(apiResponse.reference())) { response.schema(new RefProperty(apiResponse.reference())); } else if (!isVoid(apiResponse.response())) { Type responseType = apiResponse.response(); final Property property = ModelConverters.getInstance().readAsProperty(responseType); if (property != null) { response.schema(ContainerWrapper.wrapContainer(apiResponse.responseContainer(), property)); appendModels(responseType); } } }
.responseSchema(responseProperty); if (output.getResponses() == null) { output.defaultResponse(response); } else if (responseProperty != null) { output.response(200, response);
private void addResponse(Operation operation, ApiResponse apiResponse, JsonView jsonView) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders(), jsonView); Map<String, Object> examples = parseExamples(apiResponse.examples()); Response response = new Response() .description(apiResponse.message()) .headers(responseHeaders); response.setExamples(examples); if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (StringUtils.isNotEmpty(apiResponse.reference())) { response.schema(new RefProperty(apiResponse.reference())); } else if (!isVoid(apiResponse.response())) { Type responseType = apiResponse.response(); final Property property = ModelConverters.getInstance().readAsProperty(responseType, jsonView); if (property != null) { response.schema(ContainerWrapper.wrapContainer(apiResponse.responseContainer(), property)); appendModels(responseType); } } }
@SuppressWarnings("deprecation") private void addResponse(Operation operation, ApiResponse apiResponse, JsonView jsonView) { Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders(), jsonView); Map<String, Object> examples = parseExamples(apiResponse.examples()); Response response = new Response().description(apiResponse.message()).headers(responseHeaders); response.setExamples(examples); if (apiResponse.code() == 0) { operation.defaultResponse(response); } else { operation.response(apiResponse.code(), response); } if (StringUtils.isNotEmpty(apiResponse.reference())) { response.schema(new RefProperty(apiResponse.reference())); } else if (!isVoid(apiResponse.response())) { Type responseType = apiResponse.response(); final Property property = ModelConverters.getInstance().readAsProperty(responseType, jsonView); if (property != null) { response.schema(ContainerWrapper.wrapContainer(apiResponse.responseContainer(), property)); appendModels(responseType); } } }