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

openapi.templates.kora.javaAsyncServerApi.mustache Maven / Gradle / Ivy

/**
 * NOTE: This class is auto generated by Kora OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
package {{package}};

{{#imports}}import {{import}};
{{/imports}}
{{#isAsync}}
import java.util.concurrent.CompletionStage;
{{/isAsync}}{{#isReactive}}
import reactor.core.publisher.Mono;
{{/isReactive}}

import java.util.List;
import java.util.Map;
import jakarta.annotation.Nullable;

@ru.tinkoff.kora.common.annotation.Generated("openapi generator kora server"){{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}
@ru.tinkoff.kora.http.server.common.annotation.HttpController{{#vendorExtensions.allowAspects}}
@ru.tinkoff.kora.common.Component{{/vendorExtensions.allowAspects}}
public{{^vendorExtensions.allowAspects}} final{{/vendorExtensions.allowAspects}} class {{classname}}Controller {
    private final {{classname}}Delegate delegate;

    public {{classname}}Controller({{classname}}Delegate delegate) {
      this.delegate = delegate;
    }
{{#operations}}
{{#operation}}
    /**
     * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}
    {{#notes}}
     * {{.}}
    {{/notes}}
     *
    {{#allParams}}
     * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
    {{/allParams}}
     * @return {{#responses}}{{message}} (status code {{code}}){{^-last}}
     *         or {{/-last}}{{/responses}}
    {{#isDeprecated}}
     * @deprecated
    {{/isDeprecated}}
    {{#externalDocs}}
     * {{description}}
     * @see {{summary}} Documentation
    {{/externalDocs}}
     */
    {{#koraAdditionalContractAnnotations}}
    {{.}}
    {{/koraAdditionalContractAnnotations}}
    @ru.tinkoff.kora.http.common.annotation.HttpRoute(method = "{{httpMethod}}", path = "{{path}}"){{#implicitHeaders}}
    @ApiImplicitParams({
    {{#headerParams}}
     TODO implicit header
    {{>implicitHeader}}
    {{/headerParams}}
    }){{/implicitHeaders}}{{#hasAuthMethods}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith(tag = @ru.tinkoff.kora.common.Tag(ApiSecurity.{{vendorExtensions.authInterceptorTag}}.class), value = ru.tinkoff.kora.http.server.common.HttpServerInterceptor.class){{/hasAuthMethods}}
    {{#vendorExtensions.x-validate}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith(ru.tinkoff.kora.validation.module.http.server.ValidationHttpServerInterceptor.class)
    {{/vendorExtensions.x-validate}}
    {{#koraInterceptors}}
    {{#interceptorTags}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith(tag = @ru.tinkoff.kora.common.Tag({ {{interceptorTags}} }), value = {{interceptorImpl}})
    {{/interceptorTags}}
    {{^interceptorTags}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith({{interceptorImpl}})
    {{/interceptorTags}}
    {{/koraInterceptors}}
    {{#vendorExtensions.x-validate}}
    @ru.tinkoff.kora.validation.common.annotation.Validate
    {{/vendorExtensions.x-validate}}
    @ru.tinkoff.kora.common.Mapping({{classname}}ServerResponseMappers.{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}ApiResponseMapper.class)
    public {{#isAsync}}CompletionStage{{/isAsync}}{{#isReactive}}Mono{{/isReactive}}<{{classname}}Responses.{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}ApiResponse> {{operationId}}({{>javaAnnotatedParams}}) {
      return this.delegate.{{operationId}}({{#vendorExtensions.requestInDelegateParams}}_serverRequest{{#hasParams}}, {{/hasParams}}{{/vendorExtensions.requestInDelegateParams}}
        {{#allParams}}{{#lambda.trim}}
        {{#hasFormParams}}{{^isFormParam}}{{paramName}},{{/isFormParam}}{{/hasFormParams}}
        {{^hasFormParams}}{{paramName}}{{^-last}},{{/-last}}{{/hasFormParams}}{{/lambda.trim}}{{/allParams}}{{#hasFormParams}}
        form{{/hasFormParams}}
      );
    }
{{>javaFormParams}}
{{/operation}}
}
{{/operations}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy