Codota Logo
Response.<init>
Code IndexAdd Codota to your IDE (free)

How to use
io.swagger.models.Response
constructor

Best Java code snippets using io.swagger.models.Response.<init> (Showing top 20 results out of 315)

  • Common ways to obtain Response
private void myMethod () {
Response r =
  • Codota Iconnew Response()
  • Codota IconString description;new Response().description(description)
  • Codota IconOperation operation;Object key;operation.getResponses().get(key)
  • Smart code suggestions by Codota
}
origin: jooby-project/jooby

private ResponseWithStatusCode buildResponse(Function<Type, Model> modelFactory,
  Map<String, Object> attributes, Predicate<Integer> statusCode) {
 Response response = new Response();
 String description = (String) attributes.get("apiResponse.message");
 Class type = (Class) attributes.get("apiResponse.response");
 if (!isVoid(type)) {
  response.setResponseSchema(modelFactory.apply(type));
 }
 response.setDescription(description);
 buildResponseHeader(attributes, "apiResponse.responseHeaders", response::addHeader);
 Integer code = (Integer) attributes.get("apiResponse.code");
 String key = code.toString();
 if (statusCode.test(code)) {
  key += "(" + type.getSimpleName() + ")";
 }
 return new ResponseWithStatusCode(key, response);
}
origin: jooby-project/jooby

  .getOrDefault("apiOperation.code", returns.statusCode());
Response response = new Response();
String doc = returns.description()
  .orElseGet(() -> FriendlyTypeName.name(returns.type()));
  .forEach(it -> consumer.accept(
    new ResponseWithStatusCode(it.getKey().toString(),
      new Response().description(it.getValue())))
  );
origin: apache/servicecomb-java-chassis

public void scanResponse() {
 if (operation.getResponses() != null) {
  Response successResponse = operation.getResponses().get(SwaggerConst.SUCCESS_KEY);
  if (successResponse != null) {
   if (successResponse.getSchema() == null) {
    // 标注已经定义了response,但是是void,这可能是在标注上未定义
    // 根据函数原型来处理response
    Property property = createResponseProperty();
    successResponse.setSchema(property);
   }
   return;
  }
 }
 Property property = createResponseProperty();
 Response response = new Response();
 response.setSchema(property);
 operation.addResponse(SwaggerConst.SUCCESS_KEY, response);
}
origin: apache/servicecomb-java-chassis

private static void generateResponse(Swagger swagger, ResponseConfig responseConfig) {
 Response response = new Response();
 Property property = generateResponseProperty(swagger, responseConfig);
 response.setSchema(property);
 response.setDescription(responseConfig.getDescription());
 if (responseConfig.getResponseHeaders() != null) {
  Map<String, Property> headers = generateResponseHeader(swagger, responseConfig.getResponseHeaders());
  response.setHeaders(headers);
 }
 responseConfig.setResponse(response);
}
origin: kongchen/swagger-maven-plugin

Map<String, Property> responseHeaders = parseResponseHeaders(apiResponse.responseHeaders());
Class<?> responseClass = apiResponse.response();
Response response = new Response()
    .description(apiResponse.message())
    .headers(responseHeaders);
origin: kongchen/swagger-maven-plugin

    Property responseProperty = RESPONSE_CONTAINER_CONVERTER.withResponseContainer(responseContainer, property);
    operation.response(responseCode, new Response()
        .description("successful operation")
        .schema(responseProperty)
  if (models.isEmpty()) {
    Property p = ModelConverters.getInstance().readAsProperty(responseClassType);
    operation.response(responseCode, new Response()
        .description("successful operation")
        .schema(p)
    operation.response(responseCode, new Response()
        .description("successful operation")
        .schema(responseProperty)
operation.defaultResponse(new Response().description("successful operation"));
origin: kongchen/swagger-maven-plugin

  if (property != null) {
    Property responseProperty = RESPONSE_CONTAINER_CONVERTER.withResponseContainer(responseContainer, property);
    operation.response(responseCode, new Response()
        .description("successful operation")
        .schema(responseProperty)
  if (models.isEmpty()) {
    Property pp = ModelConverters.getInstance().readAsProperty(responseClass);
    operation.response(responseCode, new Response()
        .description("successful operation")
        .schema(pp)
    operation.response(responseCode, new Response()
        .description("successful operation")
        .schema(responseProperty)
ResponseStatus responseStatus = findMergedAnnotation(method, ResponseStatus.class);
if (responseStatus != null) {
  operation.response(responseStatus.value().value(), new Response().description(responseStatus.reason()));
int code = responseStatus.code().value();
String description = defaultIfEmpty(responseStatus.reason(), responseStatus.code().getReasonPhrase());
operation.response(code, new Response().description(description));
operation.defaultResponse(new Response().description("successful operation"));
origin: rakam-io/rakam

String value = annotation.authorizations()[0].value();
if (value != null && !value.isEmpty()) {
  operation.response(FORBIDDEN.code(), new Response()
      .schema(new RefProperty("ErrorMessage"))
      .description(value + " is invalid"));
origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.core

private Response getDefaultResponse() {
  Response response = new Response();
  response.setDescription("OK");
  return response;
}
origin: com.vmware.xenon/xenon-swagger

private Response responseOk() {
  Response res = new Response();
  res.setDescription(DESCRIPTION_SUCCESS);
  return res;
}
origin: com.vmware.xenon/xenon-swagger

private Response responseNoContent() {
  Response res = new Response();
  res.setDescription(DESCRIPTION_ERROR);
  return res;
}
origin: wso2/carbon-apimgt

private Response getDefaultResponse() {
  Response response = new Response();
  response.setDescription("OK");
  return response;
}
origin: com.haulmont.cuba/cuba-rest-api

protected Response getErrorResponse(String msg) {
  return new Response()
      .description(msg)
      .schema(getErrorSchema());
}
origin: com.vmware.xenon/xenon-swagger

private Response responseGenericError() {
  Response res = new Response();
  res.setDescription(DESCRIPTION_ERROR);
  res.setSchema(refProperty(modelForPodo(ServiceErrorResponse.class)));
  return res;
}
origin: com.vmware.xenon/xenon-swagger

private Response responseOk(Class<?> type) {
  Response res = new Response();
  res.setDescription(DESCRIPTION_SUCCESS);
  if (type == null) {
    return res;
  }
  res.setSchema(refProperty(modelForPodo(type)));
  return res;
}
origin: com.vmware.xenon/xenon-swagger

private Response responseOk(ServiceDocument template) {
  Response res = new Response();
  res.setDescription(DESCRIPTION_SUCCESS);
  res.setSchema(refProperty(modelForServiceDocument(template)));
  return res;
}
origin: tminglei/binder-swagger-java

@Override
public Response mToResponse(Framework.Mapping<?> mapping) {
  return new Response().schema(mToProperty(mapping))
      .description(attach(mapping).desc());
}
origin: org.apache.servicecomb/swagger-generator-core

private static void generateResponse(Swagger swagger, ResponseConfig responseConfig) {
 Response response = new Response();
 Property property = generateResponseProperty(swagger, responseConfig);
 response.setSchema(property);
 response.setDescription(responseConfig.getDescription());
 if (responseConfig.getResponseHeaders() != null) {
  Map<String, Property> headers = generateResponseHeader(swagger, responseConfig.getResponseHeaders());
  response.setHeaders(headers);
 }
 responseConfig.setResponse(response);
}
origin: com.haulmont.cuba/cuba-rest-api

protected Operation generateEntityDeleteOperation(ModelImpl entityModel) {
  return new Operation()
      .tag(entityModel.getName())
      .produces(APPLICATION_JSON_VALUE)
      .summary("Deletes the entity: " + entityModel.getName())
      .parameter(new PathParameter()
          .name("entityId")
          .description("Entity identifier")
          .required(true)
          .property(new StringProperty()))
      .response(200, new Response().description("Success. Entity was deleted."))
      .response(403, getErrorResponse("Forbidden. The user doesn't have permissions to delete the entity"))
      .response(404, getErrorResponse("Not found. MetaClass for the entity with the given name not found."));
}
origin: com.haulmont.cuba/cuba-rest-api

protected Operation generateQueryOperation(RestQueriesConfiguration.QueryInfo query, RequestMethod method) {
  Operation operation = new Operation()
      .tag(query.getEntityName() + " Queries")
      .produces(APPLICATION_JSON_VALUE)
      .summary(query.getName())
      .description("Executes a predefined query. Query parameters must be passed in the request body as JSON map.")
      .response(200, new Response()
          .description("Success")
          .schema(new ArrayProperty(new RefProperty(ENTITY_DEFINITION_PREFIX + query.getEntityName()))))
      .response(403, getErrorResponse("Forbidden. A user doesn't have permissions to read the entity."))
      .response(404, getErrorResponse("Not found. MetaClass for the entity with the given name not found."));
  operation.setParameters(generateQueryOpParams(query, method, true));
  return operation;
}
io.swagger.modelsResponse<init>

Popular methods of Response

  • getSchema
  • description
  • getHeaders
  • schema
  • getDescription
  • getResponseSchema
  • getExamples
  • headers
  • setDescription
  • setSchema
  • setResponseSchema
  • getVendorExtensions
  • setResponseSchema,
  • getVendorExtensions,
  • setExamples,
  • setHeaders,
  • addHeader,
  • responseSchema,
  • setVendorExtension,
  • example,
  • setVendorExtensions

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • putExtra (Intent)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now