On 04/25/2014 05:51 PM, Coeuz wrote:
How would I specify “first” and “last” as required_input, and "account"
and “email” as required_output?
And most importantly, how would I access them?
If this is not implemented (I think it’s not), a possibility would be to
indicate the nested documents with a “.” hierarchy:
required_input = (“name.first”,“name.second”)
required_output = (“id”,“status.account”,“status.email”)
you are right that it’s not possible right now although the newest
structures in GH master allow you to express similar intent. I’m
thinking of List, Dict and ListOfDicts SIO types - here you can see them
This is close but no biscuit - they’re not exactly what you’re looking
for and I like your idea of dot-separated elements.
Question is, how to express data types and the optional nature of
No matter how much I like the Hungarian language I just can’t think
warmly of the Hungarian notation but still I guess we would have to
employ something like:
(‘name.first’, ‘name.i_account_no’, ‘name.address.b_for_priv’)
Now, supposing ‘address’ were optional but once it was provided,
‘for_priv’ were not, we would have something akin to:
(‘name.first’, ‘name.i_account_no’, ‘name.?address.b_for_priv’)
Now, we could do away with a lot of those if we expanded the default
prefix and suffix mappings to data types.
For instance, right now - is_* and should_* indicate a boolean value.
There is nothing preventing us from adding more of these, like
(and similar) would all indicate integers.
I’m a big fan of useful conventions over detailed configuration and I
trust people would prefer to use such particular name patterns instead
of the Hungarian notation - which would still be there, just in case
We’d really need to think about how it would work for bigger documents -
say, a schema of 100 input elements, various data types - lists, dicts,
ints, floats, booleans - half of these optional.
Perhaps we’d need to find a well-defined schema and try to express it
using the syntax as above, or a similar one that we’d work out here.
What do you think about it?