Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String enums validate tags do not handle spaces in enum values #267

Closed
geoffreybauduin opened this issue Mar 5, 2025 · 1 comment
Closed

Comments

@geoffreybauduin
Copy link
Contributor

When the spec contains an enum value with spaces, the validation tags does not handle those spaces.
By default, enum values are separated by spaces in the validate tag, which conflicts with spaces within the enum value itself.
In order to solve this, enum values can be encapsulated within single quotes (see go-playground/validator#541)

Submitting PR

geoffreybauduin added a commit to geoffreybauduin/asyncapi-codegen that referenced this issue Mar 5, 2025
This commit introduces management of spaces within enum values when using validation tags.
Spaces are handled by adding single quotes around the enum value

Relates to lerenn#267
geoffreybauduin added a commit to geoffreybauduin/asyncapi-codegen that referenced this issue Mar 10, 2025
This commit introduces management of spaces within enum values when using validation tags.
Spaces are handled by adding single quotes around the enum value

Relates to lerenn#267
lerenn pushed a commit that referenced this issue Mar 10, 2025
This commit introduces management of spaces within enum values when using validation tags.
Spaces are handled by adding single quotes around the enum value

Relates to #267
@lerenn
Copy link
Owner

lerenn commented Mar 10, 2025

Associated PR is merged, so I think this is good.
Feel free to reopen if there is any trouble :)

@lerenn lerenn closed this as completed Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants