Package 

Class Validate.BodyValidator

    • Constructor Summary

      Constructors 
      Constructor Description
      BodyValidator(ServerRequest request, Class<T> bodyType, Function0<ObjectMapper> objectMapperFactory)
    • Method Summary

      Modifier and Type Method Description
      final Mono<ServerResponse> validate(Function1<T, Mono<ServerResponse>> handler, Function1<String, T> readValue) Validates the body and calls handler if the validation succeeds
      final ServerResponse validateAndAwait(SuspendFunction1<T, ServerResponse> handler, Function1<String, T> readValue) Validates the body and calls handler if the validation succeeds.
      final ServerRequest getRequest()
      final Class<T> getBodyType()
      final Function0<ObjectMapper> getObjectMapperFactory()
      • Methods inherited from class io.github.cdimascio.openapi.Validate.BodyValidator

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

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

      • BodyValidator

        BodyValidator(ServerRequest request, Class<T> bodyType, Function0<ObjectMapper> objectMapperFactory)
    • Method Detail

      • validate

         final Mono<ServerResponse> validate(Function1<T, Mono<ServerResponse>> handler, Function1<String, T> readValue)

        Validates the body and calls handler if the validation succeeds

      • validateAndAwait

         final ServerResponse validateAndAwait(SuspendFunction1<T, ServerResponse> handler, Function1<String, T> readValue)

        Validates the body and calls handler if the validation succeeds. It's a suspended alternative to a validate method.