toResponseEntity

fun <P : Parameters, I : Input<*, *>, O : Outputs> HttpEndpoint<P, I, O>.toResponseEntity(response: Response<*>): ResponseEntity<Any?>(source)

Converts a Tapik Response produced by an endpoint with a single output into a Spring ResponseEntity.

Receiver

Tapik endpoint that defines the available outputs.

Return

Spring response entity containing the encoded payload, headers, and status.

Parameters

response

endpoint response to render.


fun <P : Parameters, I : Input<*, *>, O : Outputs> HttpEndpoint<P, I, O>.toResponseEntity(choice: OneOf): ResponseEntity<Any?>(source)

Converts a Tapik OneOf response produced by an endpoint with multiple outputs into a Spring ResponseEntity.

Receiver

Tapik endpoint that defines the available outputs.

Return

Spring response entity containing the encoded payload, headers, and status.

Parameters

choice

union capturing which output branch was selected.


fun <P : Parameters, I : Input<*, *>, O : Outputs> HttpEndpoint<P, I, O>.toResponseEntity(result: Any): ResponseEntity<Any?>(source)

Converts an arbitrary Tapik response representation into a Spring ResponseEntity.

Receiver

Tapik endpoint that defines the available outputs.

Return

Spring response entity containing the encoded payload, headers, and status.

Parameters

result

either a concrete Response or OneOf union emitted by the endpoint implementation.