1+ package {package};
2+
3+ {#for imp in imports}
4+ import {imp.import};
5+ {/for}
6+ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
7+ {#if hasAuthMethods || custom-register-providers.orEmpty.size > 0}
8+ import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
9+ {/if}
10+ {#if hasAuthMethods}
11+ import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
12+ import {package}.auth.CompositeAuthenticationProvider;
13+ {#if client-headers-factory is 'default'}
14+ import {package}.auth.AuthenticationPropagationHeadersFactory;
15+ {/if}
16+ {/if}
17+
18+ import java.io.InputStream;
19+ import java.io.OutputStream;
20+ import java.util.List;
21+ import java.util.Map;
22+ import jakarta.ws.rs.*;
23+ import jakarta.ws.rs.core.MediaType;
24+
25+ import jakarta.enterprise.context.ApplicationScoped;
26+
27+ import io.quarkiverse.openapi.generator.annotations.GeneratedClass;
28+ import io.quarkiverse.openapi.generator.annotations.GeneratedMethod;
29+ import io.quarkiverse.openapi.generator.annotations.GeneratedParam;
30+
31+ {#if appName}
32+ /**
33+ * {appName}
34+ * {#if appDescription}<p>{appDescription}</p>{/if}
35+ */
36+ {/if}
37+ @Path("{#if useAnnotatedBasePath}{contextPath}{/if}{commonPath}")
38+ @RegisterRestClient({#if defaultServerUrl}baseUri="{defaultServerUrl}",{/if}configKey="{configKey}")
39+ @GeneratedClass(value="{openapi:parseUri(inputSpec)}", tag = "{baseName}")
40+ {#if hasAuthMethods}
41+ @RegisterProvider(CompositeAuthenticationProvider.class)
42+ {#when client-headers-factory}
43+ {#is 'default'}
44+ @RegisterClientHeaders(AuthenticationPropagationHeadersFactory.class)
45+ {#is 'none'}
46+ @RegisterClientHeaders
47+ {#else}
48+ @RegisterClientHeaders({client-headers-factory}.class)
49+ {/when}
50+ {/if}
51+ {#for crpClassConfig in custom-register-providers.orEmpty}
52+ @RegisterProvider({crpClassConfig}.class)
53+ {/for}
54+ @ApplicationScoped
55+ public interface {classname} {
56+
57+ public default void myCustomMethod() {
58+ }
59+
60+ {#for op in operations.operation}
61+ {#if !op.isDeprecated || openapi:genDeprecatedApiAttr(package, classname, classes-codegen)}
62+ {#if op.summary}
63+ /**
64+ * {op.summary}
65+ *
66+ {#if op.notes}
67+ * {op.notes}
68+ *
69+ {/if}
70+ */
71+ {/if}
72+ @{op.httpMethod}
73+ {#if op.subresourceOperation}
74+ @Path("{op.path}")
75+ {/if}
76+ {#if op.hasConsumes}
77+ @Consumes(\{{#for consume in op.consumes}"{consume.mediaType}"{#if consume_hasNext}, {/if}{/for}\})
78+ {/if}
79+ {#if op.hasProduces}
80+ @Produces(\{{#for produce in op.produces}"{produce.mediaType}"{#if produce_hasNext}, {/if}{/for}\})
81+ {/if}
82+ @GeneratedMethod ("{op.operationIdOriginal}")
83+ {#for cbClassConfig in circuit-breaker.orEmpty}{#if cbClassConfig.key == package + classname}
84+ {#for cbMethod in cbClassConfig.value.orEmpty}{#if cbMethod == op.nickname}
85+ @org.eclipse.microprofile.faulttolerance.CircuitBreaker
86+ {/if}{/for}
87+ {/if}{/for}
88+ {#if mutiny}
89+ {#if return-response}
90+ public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> {op.nickname}(
91+ {#else}
92+ {#if op.returnType == "void"}
93+ public {#if op.returnType}io.smallrye.mutiny.Uni<Void>{#else}io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response>{/if} {op.nickname}(
94+ {#else}
95+ public {#if op.returnType}io.smallrye.mutiny.Uni<{op.returnType}>{#else}io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response>{/if} {op.nickname}(
96+ {/if}
97+ {/if}
98+ {#else}
99+ {#if return-response}
100+ public jakarta.ws.rs.core.Response {op.nickname}(
101+ {#else}
102+ public {#if op.returnType}{op.returnType}{#else}jakarta.ws.rs.core.Response{/if} {op.nickname}(
103+ {/if}
104+ {/if}
105+ {#if op.hasFormParams}
106+ {#if is-resteasy-reactive}
107+ @jakarta.ws.rs.BeanParam {op.operationIdCamelCase}MultipartForm multipartForm{#if op.hasPathParams},{/if}{!
108+ !}{#for p in op.pathParams}{#include templates.path_params param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasQueryParams},{/if}{!
109+ !}{#for p in op.queryParams}{#include templates.query_params param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasBodyParams},{/if}{!
110+ !}{#for p in op.bodyParams}{#include bodyParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasHeaderParams},{/if}{!
111+ !}{#for p in op.headerParams}{#include headerParams.qute param=p/}{#if p_hasNext}, {/if}{/for}
112+ {#else}
113+ @org.jboss.resteasy.annotations.providers.multipart.MultipartForm {op.operationIdCamelCase}MultipartForm multipartForm{#if op.hasPathParams},{/if}{!
114+ !}{#for p in op.pathParams}{#include pathParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasQueryParams},{/if}{!
115+ !}{#for p in op.queryParams}{#include queryParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasBodyParams},{/if}{!
116+ !}{#for p in op.bodyParams}{#include bodyParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasHeaderParams},{/if}{!
117+ !}{#for p in op.headerParams}{#include headerParams.qute param=p/}{#if p_hasNext}, {/if}{/for}
118+ {/if}
119+ {#else}
120+ {#for p in op.allParams}
121+ {#if p.hasValidation}@jakarta.validation.Valid {/if}{#include pathParams.qute param=p/}{#include queryParams.qute param=p/}{#include bodyParams.qute param=p/}{#include headerParams.qute param=p/}{#if p_hasNext}, {/if}
122+ {/for}
123+ {/if}
124+ );
125+ {#if op.hasFormParams}
126+
127+ {#include multipartFormdataPojo.qute param=op/}
128+ {/if}
129+
130+ {/if} {! check deprecated !}
131+ {/for}
132+ }
0 commit comments