pepkit / eido

Validator for PEP objects
http://eido.databio.org
BSD 2-Clause "Simplified" License
4 stars 6 forks source link

name for input attrs #19

Closed nsheff closed 4 years ago

nsheff commented 4 years ago

The current eido dev docs say:

In the above example, we listed read1 and read2 attributes as required. This will enforce that these attributes must be defined on the samples, but for this example, this is not enough -- these also must point to files that exist. Checking for files is outside the scope of JSON Schema, which only validates JSON documents, so eido extends JSON Schema with the ability to specify which attributes should point to files.

Eido provides two ways to do it: input_attrs and required_input_attrs. The basic input_attrs is simply used to specify which attributes point to files, which are not required to exist. This is useful for tools that want to calculate the total size of any provided inputs, for example. The required_input_attrs list specifies that the attributes point to files that must exist, otherwise the PEP doesn't validate. Here's an example of specifying an optional and required input attribute:

What should we name these?

@stolarczyk says current actual implementation is using:

nsheff commented 4 years ago

since whatever we decide now we'll be stuck with, maybe we should think about this for a minute. Should we have something in there about 'file' instead of 'input', for the ones that require files?

Maybe: required_files?

I'm also thinking maybe the attr/attrs thing should go; it's sort of redundant, right? The JSON schema doesn't use required_attrs, it just says required:... it's self explanatory that it's referring to attributes.

So, to summarize, you can specify 3 things in a PEP schema:

nsheff commented 4 years ago

@afrendeiro any comments?

afrendeiro commented 4 years ago

Yep, simply required and required_files would be good.

nsheff commented 4 years ago

went with required, required_files, and files.