Skip to content

Matches is producing anyof multiple Patterns in the Swagger #153

@ShimonShore

Description

@ShimonShore

When I have a single pattern in my validation rule multiple patterns appear in the Swagger. How do get it to just have a single pattern.

The following Validation Rules:

        RuleFor(p => p.Wallet).MaximumLength(10);
        RuleFor(p => p.Wallet).Matches(@"^[0-9a-zA-Z ]+$");

are producing the following Swagger:

      "Wallet": {
        "maxLength": 10,
        "type": "string",
        "allOf": [
          {
            "pattern": "^[0-9a-zA-Z ]+$"
          },
          {
            "pattern": "^[0-9a-zA-Z ]+$"
          },
          {
            "pattern": "^[0-9a-zA-Z ]+$"
          },
          {
            "pattern": "^[0-9a-zA-Z ]+$"
          }
        ],

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