endgen/endpoints-templates/Endpoints.ftl

18 lines
665 B
Text
Raw Normal View History

2025-04-09 20:00:23 +02:00
package ${config.package}
2025-04-01 20:38:42 +02:00
class Endpoints(override val config: OAuthUtils.OAuthConfig) extends framework.service.api.Endpoints with RutTapir with RutUtilsCodec:
type ApiEndpoint[I, O] = OAuthEndpoint[RequestMeta.OAuthRequestMeta, I, ProblemDetail, O]
<#list endpoints as endpoint>
2025-04-09 20:00:23 +02:00
val ${endpoint.inputType?uncap_first}Endpoint = ApiEndpoint[${endpoint.inputType?cap_first}, VersionedResponse] =
2025-04-01 20:38:42 +02:00
<#list endpoint.paths.paths>
apiV1Endpoint
.post
<#items as segment>
.in("${segment}")
</#items>
.in(jsonBody[${endpoint.inputType?cap_first}])
.out(jsonBody[VersionedResponse])
</#list>
</#list>