AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 351 forks source link

Validators for the number of responses in multiselect #362

Closed MAD-py closed 2 years ago

MAD-py commented 3 years ago

In order to have a more complete API and remove worries to the user, I propose to add a series of validators that can make things easier for the user, at this moment I only propose two very simple validators to validate the maximum and minimum of selected answers in a multiselect.

I would like to know what do you think about the proposal and if it is possible to make more validators that can be useful.

Personally I would like to have a number of validators similar to the Pydantic library of python.

AlecAivazis commented 2 years ago

Sorry i haven't gotten to this yet @MAD-py. work was really busy this week, will try to find some time to look at it over the weekend

MAD-py commented 2 years ago

@AlecAivazis no problem. Actually I had a pretty busy week too.

MAD-py commented 2 years ago

hi @AlecAivazis

I've already added the validators info in the README, I'll be working on more validators that are useful for the API and in a while I'll be doing the corresponding PR.

AlecAivazis commented 2 years ago

Thanks for doing that! I'll merge this in once github gives us the 👍