All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jersey2-v3template.ClientService.mustache Maven / Gradle / Ivy

Go to download

jersey2 generator from openapi 3.x spec files. Changing to openapitools dependencies.

There is a newer version: 6.6
Show newest version
package {{package}};

import cd.connect.openapi.support.ApiClient;
import cd.connect.openapi.support.ApiResponse;
import cd.connect.openapi.support.Pair;
import javax.ws.rs.BadRequestException;

import javax.ws.rs.core.GenericType;
import java.io.InputStream;

import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;

import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;

{{#imports}}import {{import}};
{{/imports}}

{{^fullJavaUtil}}
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
{{/fullJavaUtil}}

{{#useBeanValidation}}
  import javax.validation.Valid;
  import javax.validation.constraints.NotNull;
{{/useBeanValidation}}

{{>generatedAnnotation}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{#operations}}
  @Path("/{{baseName}}")
  public interface {{classname}}ClientService {

  {{#operation}}
    /**
    * {{summary}}
    * {{notes}}
    {{#allParams}}
      * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
    {{/allParams}}
    {{#returnType}}
      * @return {{returnType}}
    {{/returnType}}
    {{#isDeprecated}}
      * @deprecated
    {{/isDeprecated}}
    {{#externalDocs}}
      * {{description}}
      * @see {{summary}} Documentation
    {{/externalDocs}}
    */
    @{{httpMethod}}{{#subresourceOperation}}
      @Path("{{path}}"){{/subresourceOperation}}{{#hasConsumes}}
      @Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
      @Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
    {{#isDeprecated}}
      @Deprecated
    {{/isDeprecated}}
    public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}Response {{/returnType}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}});

    /**
    * {{summary}}
    * {{notes}}
    {{#allParams}}
      * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
    {{/allParams}}
    {{#returnType}}
      * @return {{returnType}}
    {{/returnType}}
    {{#isDeprecated}}
      * @deprecated
    {{/isDeprecated}}
    {{#externalDocs}}
      * {{description}}
      * @see {{summary}} Documentation
    {{/externalDocs}}
    */
    @{{httpMethod}}{{#subresourceOperation}}
      @Path("{{path}}"){{/subresourceOperation}}{{#hasConsumes}}
      @Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
      @Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
    {{#isDeprecated}}
      @Deprecated
    {{/isDeprecated}}
    public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}Response {{/returnType}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}Map extraHeaders);


    /**
    * {{summary}}
    * {{notes}}
    {{#allParams}}
      * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
    {{/allParams}}
    {{#returnType}}
      * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
    {{/returnType}}
    {{#isDeprecated}}
      * @deprecated
    {{/isDeprecated}}
    {{#externalDocs}}
      * {{description}}
      * @see {{summary}} Documentation
    {{/externalDocs}}
    */
    {{#isDeprecated}}
      @Deprecated
    {{/isDeprecated}}
    public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
  {{/operation}}
    }
{{/operations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy