def get_archivelab_org_validator():
    class PatchedManifestValidator(ManifestValidator):
        # Replace the image API with the presentation API at manifest level.
        def context_field(self, value):
            if value == 'http://iiif.io/api/image/2/context.json':
                self.log_warning("@context", "Applied library specific corrections. "
                                                 "Replaced image context with presentation context.")
                return self.PRESENTATION_API_URI
            return value

    class PatchedSequenceValidator(SequenceValidator):
        @SequenceValidator.errors_to_warnings
        def context_field(self, value):
            return super().context_field(value)

    class PatchedAnnotationValidator(AnnotationValidator):
        REQUIRED_FIELDS = AnnotationValidator.REQUIRED_FIELDS - {"on", "@type"}

        def setup(self):
            self.ImageSchema['type'] = self.type_field

    iv = IIIFValidator()
    iv.ManifestValidator = PatchedManifestValidator
    iv.AnnotationValidator = PatchedAnnotationValidator
    iv.SequenceValidator = PatchedSequenceValidator
    return iv
def get_vatlib_it_validator():
    class PatchedAnnotationValidator(AnnotationValidator):
        def setup(self):
            self.REQUIRED_FIELDS = AnnotationValidator.REQUIRED_FIELDS - {"on"}
            self.RECOMMENDED_FIELDS = AnnotationValidator.RECOMMENDED_FIELDS & {"on"}

    class PatchedCanvasValidator(CanvasValidator):
        def viewing_hint_field(self, value):
            val, errs = self.mute_errors(super().viewing_hint_field, value)
            if errs:
                if val == "paged":
                    self.log_warning("viewingHint", "Applied library specific corrections. Allowd value 'paged'.")

    iv = IIIFValidator()
    iv.AnnotationValidator = PatchedAnnotationValidator
    iv.CanvasValidator = PatchedCanvasValidator
    return iv