Function checkResponseValidation

Determines response schema validation results and conceptually returns one of three states: valid, invalid (soft validation error), or invalid (hard validation error). For invalid cases, additional metadata is included in the result.

  • Parameters

    • __namedParameters: {
          resBody: SerializationResult | DeserializationResult<Partial<any>>;
          resHeaders: SerializationResult | DeserializationResult<Partial<AnyHeaders>>;
          resStatus: SerializationResult | DeserializationResult<number>;
          validationMode: ValidationMode;
      }
      • resBody: SerializationResult | DeserializationResult<Partial<any>>
      • resHeaders: SerializationResult | DeserializationResult<Partial<AnyHeaders>>
      • resStatus: SerializationResult | DeserializationResult<number>
      • validationMode: ValidationMode

    Returns ({ ok: true; } & ({ hadSoftValidationError: false; invalidPart?: undefined; validationError?: undefined; validationErrorPath?: undefined; } | { hadSoftValidationError: true; invalidPart: "headers" | "body" | "status"; validationError: string; validationErrorPath: string; })) | {
        invalidPart: "headers" | "body" | "status";
        ok: false;
        validationError: string;
        validationErrorPath: string;
    }