biothings / discovery-app

The Data Discovery Engine project by the CD2H Data working-group
http://discovery.biothings.io
Apache License 2.0
4 stars 9 forks source link

Enable optional requirements #210

Closed gtsueng closed 3 months ago

gtsueng commented 1 year ago

Is your feature request related to a problem? Please describe. For identifier-specific properties, it would be nice to require one of several options: Eg- require pmid or doi or both. This kind of optional requirement is allowable in JSON-schema

Describe the solution you'd like Display the following: in the schema playground viewer:

                "anyOf": [
                    {"required":["name"]},
                    {"required":["inChI"]},
                    {"required":["smiles"]}
                ]

Describe alternatives you've considered Making them all recommended, is not desirable as users are just as likely to ignore recommended properties as they are optional ones. Making all required is unreasonable, as there are tools to help find the others, once one is in place.

Additional context Add any other context or screenshots about the feature request here.

gtsueng commented 1 year ago

An example schema with this issue is bioschemasdrafts:MolecularEntity which looks a little strange in the DDE.

gtsueng commented 1 year ago

We might be able to display it this way in the DDE without affecting the DDE's overall template too much: image

gtsueng commented 1 year ago

example from JSON Schema documentation: https://json-schema.org/understanding-json-schema/reference/conditionals.html#implication