Skip to content

Why do the *Validator traits have the regex function? #492

Closed

Description

@Kriskras99

SchemaNameValidator, SchemaNamespaceValidator, EnumSymbolNameValidator and RecordFieldNameValidator all include a regex function:

fn regex(&self) -> &'static Regex {
    ...
}

What's the usecase for this? The validate functions cover all usecases I can think of.

Activity

  1. martin-g commented on Feb 28, 2026

    @martin-g
    Member

    The default validate() impls use the regex() to do their job.

    AFAIR the idea was to make the default regex available for any custom validate() impls in case they need it.
    But since they are custom then most probably they won't use it ...

  2. Kriskras99 commented on Feb 28, 2026

    @Kriskras99
    ContributorAuthor

    That would make sense, but there is no default implementation for validate.

    I think it would be good to add a default implementation.

  3. martin-g commented on Mar 2, 2026

    @martin-g
    Member

    The default validate() impls use the regex() to do their job.

    By default I meant the implementations in the respective SpecificationXyzValidator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions