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

templates.api.mustache Maven / Gradle / Ivy

{{>licenseInfo}}

package {{packageName}};

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

{{>generatedAnnotation}}
{{#madaApi.mpProviders}}
@RegisterProvider({{.}}.class)
{{/madaApi.mpProviders}}
{{#madaApi.mpRestClientConfigKey}}
@RegisterRestClient(configKey = "{{madaApi.mpRestClientConfigKey}}")
{{/madaApi.mpRestClientConfigKey}}
@Path("{{commonPath}}")
public interface {{classname}} {
{{#operations}}{{#operation}}
  /**
    {{#summary}}
   * {{summary}}
    {{/summary}}
    {{#notes}}
   * {{notes}}
    {{/notes}}
    {{^summary}}
        {{^notes}}
   * {{nickname}}.
        {{/notes}}
    {{/summary}}
{{#madaOp.renderJavadocMacroSpacer}}
   *
{{/madaOp.renderJavadocMacroSpacer}}
{{#allParams}}
   * @param {{paramName}} {{#description}}{{description}}{{/description}}{{#validation}}{{#notNull}} (not null){{/notNull}}{{^notNull}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/notNull}}{{/validation}}
{{/allParams}}
{{#madaOp.renderJavadocReturn}}
   * @return {{returnType}}
{{/madaOp.renderJavadocReturn}}
{{#externalDocs}}
   * {{description}}
   * @see {{summary}} Documentation
{{/externalDocs}}
   */
  @{{httpMethod}}
  {{#path}}
  @Path("{{{path}}}")
  {{/path}}
  {{#madaOp.consumes}}
  @Consumes({{{madaOp.consumes}}})
  {{/madaOp.consumes}}
  {{#madaOp.produces}}
  @Produces({{{madaOp.produces}}})
  {{/madaOp.produces}}
  {{#madaOp.hasResponses}}
  {{#madaOp.responseSchema}}
  {{#responses}}
  @APIResponseSchema({{baseType}}.class)
  {{/responses}}
  {{/madaOp.responseSchema}}
  {{^madaOp.responseSchema}}
  @APIResponses({
    {{#responses}}
    @APIResponse(responseCode = "{{code}}", description = "{{{description}}}"{{#baseType}},
                 content = @Content(schema = @Schema(implementation = {{{baseType}}}.class{{#containerType}}, type = {{{.}}}{{/containerType}}{{#isUnique}}, uniqueItems = true{{/isUnique}}){{#mediaType}}, mediaType = {{{.}}}{{/mediaType}}){{/baseType}}){{^-last}},{{/-last}}
    {{/responses}}
  })
  {{/madaOp.responseSchema}}
  {{/madaOp.hasResponses}}
  {{#madaOp.summaryString}}
  @Operation(summary = "{{{madaOp.summaryString}}}")
  {{/madaOp.summaryString}}
  {{>returnTypes}} {{nickname}}({{#allParams}}{{>formParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^-last}}, {{/-last}}{{/allParams}});
  {{/operation}}
{{/operations}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy