Added types declarations
This commit is contained in:
parent
857f9c63a6
commit
127e4013e0
7 changed files with 42 additions and 41 deletions
|
@ -10,6 +10,14 @@ import sttp.tapir.Schema
|
|||
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 datatypes as datatype>
|
||||
case class ${datatype.name}(
|
||||
<#list datatype.fields as field>
|
||||
${field.name} : ${field.type},
|
||||
</#list>
|
||||
)
|
||||
</#list>
|
||||
|
||||
<#list endpoints as endpoint>
|
||||
case class ${endpoint.handler.name?cap_first}(
|
||||
<#list endpoint.handler.fields as field>
|
||||
|
@ -18,20 +26,23 @@ class Endpoints(override val config: OAuthUtils.OAuthConfig) extends framework.s
|
|||
)
|
||||
</#list>
|
||||
|
||||
<#list datatypes as datatype>
|
||||
given Codec[${datatype.name?cap_first}] = deriveCodec
|
||||
</#list>
|
||||
<#list endpoints as endpoint>
|
||||
given Codec[${endpoint.handler.name?cap_first}] = deriveCodec
|
||||
</#list>
|
||||
|
||||
<#list endpoints as endpoint>
|
||||
val ${endpoint.handler.name}Endpoint = ApiEndpoint[${endpoint.handler.name?cap_first}, VersionedResponse] =
|
||||
<#list endpoint.paths.paths>
|
||||
apiV1Endpoint
|
||||
.post
|
||||
<#items as segment>
|
||||
.in("${segment}")
|
||||
</#items>
|
||||
.post
|
||||
.in(jsonBody[${endpoint.handler.name?cap_first}])
|
||||
.out(jsonBody[VersionedResponse])
|
||||
</#list>
|
||||
val ${endpoint.handler.name}Endpoint = ApiEndpoint[${endpoint.handler.name?cap_first}, VersionedResponse] =
|
||||
<#list endpoint.paths.paths>
|
||||
apiV1Endpoint
|
||||
.post
|
||||
<#items as segment>
|
||||
.in("${segment}")
|
||||
</#items>
|
||||
.post
|
||||
.in(jsonBody[${endpoint.handler.name?cap_first}])
|
||||
.out(jsonBody[VersionedResponse])
|
||||
</#list>
|
||||
</#list>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue