Skip to content

[C++] Map key value string length message misleading #852

@xamix

Description

@xamix

Hi,

I use the following rules on a map<string, string>:

(validate.rules).map.keys.string.min_len = 1,

And when the rule is not respected, the error message is ending by:

value length must be at least 1 characters

Shouldn't it be:

key length must be at least 1 characters

Besause it is not clear if the key or the value do not respect the rule

Regards

Activity

added
BugReports and/or fixes a bug
C++C++ language support
on Apr 26, 2023
lehuunhan404

lehuunhan404 commented on Jun 27, 2023

@lehuunhan404

[GO]
I use the following rules on a map<string, string>

[(validate.rules).map = {ignore_empty: true, keys: {string: {ignore_empty: true, pattern:"^[a-zA-Z- ]+$"}}, values: {string : {ignore_empty: true, pattern:"^[^<>]+$"}}}];

In file validate.go:

image

Regards

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

    BugReports and/or fixes a bugC++C++ language support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rodaine@xamix@lehuunhan404

        Issue actions

          [C++] Map key value string length message misleading · Issue #852 · bufbuild/protoc-gen-validate