Package 

Class Validate.Request

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final ServerRequest request
      private final Function0<ObjectMapper> objectMapperFactory
    • Constructor Summary

      Constructors 
      Constructor Description
      Request(ServerRequest request, Function0<ObjectMapper> objectMapperFactory)
    • Method Summary

      Modifier and Type Method Description
      final <T extends Any> Mono<ServerResponse> withBody(Class<T> bodyType, Function1<T, Mono<ServerResponse>> handler) Validates a request with body of type bodyType.
      final <T extends Any> Mono<ServerResponse> withBody(Class<T> bodyType, Function1<String, T> readValue, Function1<T, Mono<ServerResponse>> handler) Validates a request with body of type bodyType.
      final <T extends Any> Mono<ServerResponse> withBody(Function1<T, Mono<ServerResponse>> handler) Reified inline version of the Request.withBody function.
      final <T extends Any> ServerResponse awaitBody(Class<T> bodyType, Function1<String, T> readValue, SuspendFunction1<T, ServerResponse> handler) Validates a request with body of type bodyType .
      final ServerRequest getRequest()
      final Function0<ObjectMapper> getObjectMapperFactory()
      • Methods inherited from class io.github.cdimascio.openapi.Validate.Request

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Request

        Request(ServerRequest request, Function0<ObjectMapper> objectMapperFactory)
    • Method Detail

      • withBody

         final <T extends Any> Mono<ServerResponse> withBody(Class<T> bodyType, Function1<T, Mono<ServerResponse>> handler)

        Validates a request with body of type bodyType. If validation succeeds, the handler is called to return a response

      • withBody

         final <T extends Any> Mono<ServerResponse> withBody(Class<T> bodyType, Function1<String, T> readValue, Function1<T, Mono<ServerResponse>> handler)

        Validates a request with body of type bodyType. If validation succeeds, the readValue function is used to transform the string body to bodyType, and the handler is called to return a response

      • withBody

         final <T extends Any> Mono<ServerResponse> withBody(Function1<T, Mono<ServerResponse>> handler)

        Reified inline version of the Request.withBody function.

        Parameters:
        handler - handler function.
      • awaitBody

         final <T extends Any> ServerResponse awaitBody(Class<T> bodyType, Function1<String, T> readValue, SuspendFunction1<T, ServerResponse> handler)

        Validates a request with body of type bodyType . If validation succeeds, the handler is called to return a response. It's a suspended alternative to a withBody method.