@{{javax}}.ws.rs.{{httpMethod}}
{{>hooks/apiMethodAnnotations}}
{{#and securityRequirements (not securityRequirements.optional)}}
{{#ifdef @root.authenticationRequiredAnnotation}}
{{#if @root.authenticationRequiredAnnotation}}
{{@root.authenticationRequiredAnnotation}}
{{/if}}
{{/ifdef}}
{{#each securityRequirements.requirements}}
{{#each schemes}}
{{#with scheme}}
{{#ifvex 'x-java-operation-annotation'}}
{{{vendorExtensions.x-java-operation-annotation}}}
{{/ifvex}}
{{/with}}
{{/each}}
{{/each}}
{{/and}}
{{#if deprecated}}
@java.lang.Deprecated
{{/if}}
{{#or groupPath path}}
@{{javax}}.ws.rs.Path("{{{groupPath}}}{{{path}}}")
{{/or}}
{{#if consumes}}
@{{javax}}.ws.rs.Consumes({ {{#each consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/each}} })
{{/if}}
{{#if produces}}
@{{javax}}.ws.rs.Produces({ {{#each produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/each}} })
{{/if}}
@io.swagger.v3.oas.annotations.Operation(
	{{#if operationId}}
	operationId = {{{stringLiteral operationId}}},
	{{/if}}
	summary = {{#if summary}}{{{stringLiteral summary}}}{{else}}""{{/if}}{{#if description}},
	description = {{{stringLiteral description}}}{{/if}},
	responses = {
	{{#each responses}}
		@io.swagger.v3.oas.annotations.responses.ApiResponse(
			responseCode = "{{{code}}}",
			description = {{{stringLiteral description}}}{{#if contents}},
			content = {
{{#each contents}}
				@io.swagger.v3.oas.annotations.media.Content(mediaType = {{{stringLiteral mediaType.mediaType}}}{{#if schema}}, schema = @io.swagger.v3.oas.annotations.media.Schema({{#if (isObject schema)}}implementation = {{{nativeType}}}.class{{/if}}){{/if}}),
{{/each}}
			}{{/if}}
		),
{{/each}}	}{{#if securityRequirements}},
	security = {
	{{#each securityRequirements.requirements}}
	{{#each schemes}}
		@io.swagger.v3.oas.annotations.security.SecurityRequirement(name = "{{scheme.name}}"{{#if scopes}}, scopes = { {{#each scopes}}{{{stringLiteral name}}}{{#hasMore}}, {{/hasMore}}{{/each}} }{{/if}}),
	{{/each}}
	{{/each}}
	{{#if securityRequirements.optional}}
		@io.swagger.v3.oas.annotations.security.SecurityRequirement(name = ""), /* Security is declared as optional */
	{{/if}}
	}{{/if}},
	tags = { {{#each tags}}"{{{.}}}"{{#hasMore}}, {{/hasMore}}{{/each}} }
)
