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

templates.java-micronaut.common.operationAnnotations.mustache Maven / Gradle / Ivy

    /**
    {{#summary}}
     * {{openbrace}}@summary {{summary}}{{closebrace}}
    {{/summary}}
    {{#notes}}
     * {{.}}
    {{/notes}}
    {{^summary}}
        {{^notes}}
     * {{nickname}}
        {{/notes}}
    {{/summary}}
    {{#vendorExtensions.originalParams}}
        {{#-first}}
     *
        {{/-first}}
     * @param {{paramName}}{{#description}} {{description}}{{/description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#vendorExtensions.x-deprecated-message}}
     *        Deprecated: {{{.}}}{{/vendorExtensions.x-deprecated-message}}
    {{/vendorExtensions.originalParams}}
    {{#returnType}}
        {{^vendorExtensions.originalParams.0}}
     *
        {{/vendorExtensions.originalParams.0}}
     * @return {{#responses}}{{message}} (status code {{code}}){{^-last}}
     *         or {{/-last}}{{/responses}}
    {{/returnType}}
    {{#isDeprecated}}
     * @deprecated{{#vendorExtensions.x-deprecated-message}} {{{.}}}{{/vendorExtensions.x-deprecated-message}}
    {{/isDeprecated}}
    {{#externalDocs}}
     * {{description}}
     *
     * @see {{summary}} Documentation
    {{/externalDocs}}
     */
    {{#generateSwagger2Annotations}}
        {{#isDeprecated}}
    @Deprecated
        {{/isDeprecated}}
    @Operation(
        operationId = "{{{operationId}}}",
        {{#summary}}
        summary = "{{{.}}}",
        {{/summary}}
        {{#notes}}
        description = "{{{.}}}",
        {{/notes}}
        {{#isDeprecated}}
        deprecated = true,
        {{/isDeprecated}}
        {{#tags.1}}
        {{!generate only when at least 2 tags}}
        tags = {{openbrace}} {{#tags}}"{{name}}"{{^-last}}, {{/-last}}{{/tags}} {{closebrace}},
        {{/tags.1}}
        responses = {{#responses.1}}{{openbrace}}
    {{/responses.1}}{{#responses}}{{#responses.1}}
            {{/responses.1}}@ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = {{#produces.1}}{{openbrace}}
                {{#produces}}
                @Content(mediaType = "{{{mediaType}}}", {{#isArray}}array = @ArraySchema({{/isArray}}schema = @Schema(implementation = {{{baseType}}}.class){{#isArray}}){{/isArray}}){{^-last}},{{/-last}}
                {{/produces}}
            {{closebrace}}{{/produces.1}}{{^produces.1}}{{#produces}}@Content(mediaType = "{{{mediaType}}}", {{#isArray}}array = @ArraySchema({{/isArray}}schema = @Schema(implementation = {{{baseType}}}.class)){{#isArray}}){{/isArray}}{{/produces}}{{/produces.1}}{{/baseType}}){{^-last}},{{/-last}}{{#responses.1}}
            {{/responses.1}}{{/responses}}{{#responses.1}}
        {{closebrace}}{{/responses.1}}{{#vendorExtensions.hasNotBodyParam}},
        parameters = {{#vendorExtensions.swaggerParams.1}}{{openbrace}}
            {{/vendorExtensions.swaggerParams.1}}{{#vendorExtensions.swaggerParams}}{{#vendorExtensions.swaggerParams.1}}
            {{/vendorExtensions.swaggerParams.1}}@Parameter(name = "{{baseName}}"{{#isDeprecated}}, deprecated = true{{/isDeprecated}}{{#description}}, description = "{{{description}}}"{{/description}}{{#required}}, required = true{{/required}}, in = ParameterIn.{{#isCookieParam}}COOKIE{{/isCookieParam}}{{#isHeaderParam}}HEADER{{/isHeaderParam}}{{#isQueryParam}}QUERY{{/isQueryParam}}{{#isPathParam}}PATH{{/isPathParam}}){{^-last}},{{/-last}}{{#vendorExtensions.hasMultipleParams}}
            {{/vendorExtensions.hasMultipleParams}}{{/vendorExtensions.swaggerParams}}{{#vendorExtensions.swaggerParams.1}}
        {{closebrace}}{{/vendorExtensions.swaggerParams.1}}{{/vendorExtensions.hasNotBodyParam}}{{#hasAuthMethods}},
        security = {{#authMethods.1}}{{openbrace}}
            {{/authMethods.1}}{{#authMethods}}{{#authMethods.1}}
            {{/authMethods.1}}@SecurityRequirement(name = "{{name}}"{{#isOAuth}}{{#scopes.1}}, scopes = {{openbrace}}{{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}}{{closebrace}}{{/scopes.1}}{{/isOAuth}}){{^-last}},{{/-last}}
            {{/authMethods}}{{#authMethods.1}}
        {{closebrace}}{{/authMethods.1}}{{/hasAuthMethods}}{{#externalDocs}},
        externalDocs = @ExternalDocumentation(description = "{{externalDocs.description}}", url = "{{externalDocs.url}}"){{/externalDocs}}
    )
    {{/generateSwagger2Annotations}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy