Skip to content

Custom validator shouldn't be triggered when optional and not present #211

Closed
@adamgotterer

Description

@adamgotterer
params do
  optional :some_param, type: Integer, custom_validator: true
end

When :some_param is not present and a custom validator is set; the custom validator will automatically be called, despite the optional setting. It seems the desired behavior when using optional would be to only call the custom validator when the param is present.

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