templates.kotlin-micronaut.common.operationAnnotations.mustache Maven / Gradle / Ivy
/**
{{#summary}}
* {{openbrace}}@summary {{summary}}{{closebrace}}
{{/summary}}
{{#notes}}
* {{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}}
{{^allParams.0}}
*
{{/allParams.0}}
* @return {{returnType}}
{{/returnType}}
{{#isDeprecated}}
*
* @deprecated{{#vendorExtensions.x-deprecated-message}} {{{.}}}{{/vendorExtensions.x-deprecated-message}}
{{/isDeprecated}}
{{#externalDocs}}
* {{description}}
*
* @see {{summary}} Documentation
{{/externalDocs}}
*/
{{#generateSwagger2Annotations}}
{{#isDeprecated}}
@Deprecated("{{#vendorExtensions.x-deprecated-message}}{{{.}}}{{/vendorExtensions.x-deprecated-message}}")
{{/isDeprecated}}
@Operation(
operationId = "{{{operationId}}}",
{{#summary}}
summary = "{{{.}}}",
{{/summary}}
{{#notes}}
description = "{{{.}}}",
{{/notes}}
{{#tags.1}}
{{!generate only when at least 2 tags}}
tags = [ {{#tags}}"{{name}}"{{^-last}}, {{/-last}}{{/tags}} ],
{{/tags.1}}
responses = [
{{#responses}}
ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = [
{{#produces}}
Content(mediaType = "{{{mediaType}}}", {{#isArray}}array = ArraySchema({{/isArray}}schema = Schema(implementation = {{{baseType}}}::class){{#isArray}}){{/isArray}}){{^-last}},{{/-last}}
{{/produces}}
]{{/baseType}}){{^-last}},{{/-last}}
{{/responses}}
]{{#vendorExtensions.hasNotBodyParam}},
parameters = [
{{#vendorExtensions.swaggerParams}}
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.swaggerParams}}
]{{/vendorExtensions.hasNotBodyParam}}{{#hasAuthMethods}},
security = [
{{#authMethods}}
SecurityRequirement(name = "{{name}}"{{#isOAuth}}{{#scopes.1}}, scopes = [{{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}}]{{/scopes.1}}{{/isOAuth}}){{^-last}},{{/-last}}
{{/authMethods}}
]{{/hasAuthMethods}}
)
{{/generateSwagger2Annotations}}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy