Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upValidate oneof with values containing space #525
Comments
|
@muhammadkholidb no, unfortunately, this isn't supported for As a workaround for now though is you can register your own custom validation function which accomplishes the same thing :) |
|
Hello |
* Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). Resolves go-playground#525.
**Make sure that you've checked the boxes below before you submit PR:** - [ ] Tests exist or have been written that cover this particular change. Change Details: * Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). @go-playground/admins
**Make sure that you've checked the boxes below before you submit PR:** - [x] Tests exist or have been written that cover this particular change. Change Details: * Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). @go-playground/admins
**Make sure that you've checked the boxes below before you submit PR:** - [x] Tests exist or have been written that cover this particular change. Change Details: * Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). @go-playground/admins
**Make sure that you've checked the boxes below before you submit PR:** - [x] Tests exist or have been written that cover this particular change. Change Details: * Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). @go-playground/admins
Fixes Or Enhances go-playground#525. **Make sure that you've checked the boxes below before you submit PR:** - [x] Tests exist or have been written that cover this particular change. Change Details: * Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). @go-playground/admins
|
Isn't this closed by #541 |
Fixes Or Enhances go-playground#525. **Make sure that you've checked the boxes below before you submit PR:** - [x] Tests exist or have been written that cover this particular change. Change Details: * Adds the ability to match on space separated strings when using the `oneof` validation. Space separted strings must be surrounded by single quotes to be validated as one string. For example: ``` oneof='Awaiting Verification' 'Verified' 'Failed Verification' ``` passes validation for a field that is exactly `Failed Verification` (though just `Failed` would...fail). @go-playground/admins

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Package version eg. v8, v9:
v9
Issue, Question or Enhancement:
Is it possible to use oneof validation with values containing space character? Tried with single quote but it did not seem to work.
Code sample, to showcase or reproduce: