Tabnine Logo
Response.<init>
Code IndexAdd Tabnine 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)

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
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JFrame (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now