TLINDEN / Data-Validate-Struct

Data::Validate::Struct - Validate recursive Hash Structures
http://search.cpan.org/dist/Data-Validate-Struct/
1 stars 3 forks source link

Open Dict Type #5

Open ambs opened 1 year ago

ambs commented 1 year ago

In a webservice I am developing, it might make sense for one parameter to be a open dictionary (hash), with just a constrain on the key / value.

Something like:

  $model = { id => 'int', metadata => 'dict(word, line)' };

This idea is still not well thought, but I decided to share it, so you can give also some input.

TLINDEN commented 1 year ago

Sounds like a good idea, I thought about implementing this validation with the current module version, but this is not possible. Also, variations of this come to mind like array(int) or even array(dict(word, array(word, line))).

ambs commented 1 year ago

Yes, the current reference structure is quite nice, because it is simple. I looked up other modules like JSON::Schema::Modern, but the reference definition is too complex for what I need.

Thus, any change here needs to be taken with caution to keep the module simple :-)